aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/klibc/klibc-1.5.15+1.5.16/ipconfig-set-null-ciaddr-on-dhcprequest.patch
blob: 7a8233559953f3790ba83c05437c7fa2e291f868 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From cfc8d649a959f845983aae4c0fc33a0a0c995c92 Mon Sep 17 00:00:00 2001
From: maximilian attems <max@stro.at>
Date: Fri, 5 Sep 2008 22:48:27 +0200
Subject: [PATCH] [klibc] ipconfig: set null ciaddr on DHCPREQUEST during SELECTING state

RFC 2131, Section 4.3.2 states:

  Clients send DHCPREQUEST messages as follows:

     o DHCPREQUEST generated during SELECTING state:

        Client inserts the address of the selected server in 'server
        identifier', 'ciaddr' MUST be zero, 'requested IP address' MUST be
        filled in with the yiaddr value from the chosen DHCPOFFER.

fixes: http://bugs.debian.org/497879

my test dhcpd seem all not that picky, ipconfig worked before
and after this RFC 2131 conformal change.

Reported-by: Craig Bernstein <cbernstein@stanford.edu>
Signed-off-by: maximilian attems <max@stro.at>
---
 usr/kinit/ipconfig/dhcp_proto.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/usr/kinit/ipconfig/dhcp_proto.c b/usr/kinit/ipconfig/dhcp_proto.c
index d4f2c09..21448f7 100644
--- a/usr/kinit/ipconfig/dhcp_proto.c
+++ b/usr/kinit/ipconfig/dhcp_proto.c
@@ -171,7 +171,8 @@ static int dhcp_send(struct netdev *dev, struct iovec *vec)
 	bootp.htype	= dev->hwtype;
 	bootp.hlen	= dev->hwlen;
 	bootp.xid	= dev->bootp.xid;
-	bootp.ciaddr	= dev->ip_addr;
+	bootp.ciaddr	= INADDR_NONE;
+	bootp.yiaddr	= dev->ip_addr;
 	bootp.giaddr	= INADDR_ANY;
 	bootp.secs	= htons(time(NULL) - dev->open_time);
 	memcpy(bootp.chaddr, dev->hwaddr, 16);
-- 
1.7.0