aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2008-03-04 20:03:49 -0500
committerDavid S. Miller <davem@davemloft.net>2008-03-04 20:03:49 -0500
commitdea75bdfa57f75a7a7ec2961ec28db506c18e5db (patch)
tree778abead15781a9b05b2b945d12a0042c8e6e593
parent3123e666ea92ab0b1762e97e0785d20a0ab25088 (diff)
[IPCONFIG]: The kernel gets no IP from some DHCP servers
From: Stephen Hemminger <shemminger@linux-foundation.org> Based upon a patch by Marcel Wappler: This patch fixes a DHCP issue of the kernel: some DHCP servers (i.e. in the Linksys WRT54Gv5) are very strict about the contents of the DHCPDISCOVER packet they receive from clients. Table 5 in RFC2131 page 36 requests the fields 'ciaddr' and 'siaddr' MUST be set to '0'. These DHCP servers ignore Linux kernel's DHCP discovery packets with these two fields set to '255.255.255.255' (in contrast to popular DHCP clients, such as 'dhclient' or 'udhcpc'). This leads to a not booting system. Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv4/ipconfig.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 10013ccee8dd..5dd938579eeb 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -753,9 +753,9 @@ static void __init ic_bootp_send_if(struct ic_device *d, unsigned long jiffies_d
753 printk("Unknown ARP type 0x%04x for device %s\n", dev->type, dev->name); 753 printk("Unknown ARP type 0x%04x for device %s\n", dev->type, dev->name);
754 b->htype = dev->type; /* can cause undefined behavior */ 754 b->htype = dev->type; /* can cause undefined behavior */
755 } 755 }
756
757 /* server_ip and your_ip address are both already zero per RFC2131 */
756 b->hlen = dev->addr_len; 758 b->hlen = dev->addr_len;
757 b->your_ip = NONE;
758 b->server_ip = NONE;
759 memcpy(b->hw_addr, dev->dev_addr, dev->addr_len); 759 memcpy(b->hw_addr, dev->dev_addr, dev->addr_len);
760 b->secs = htons(jiffies_diff / HZ); 760 b->secs = htons(jiffies_diff / HZ);
761 b->xid = d->xid; 761 b->xid = d->xid;