patch-2.4.15 linux/net/ipv4/ipconfig.c
Next file: linux/net/ipv4/tcp_input.c
Previous file: linux/net/ipv4/ip_input.c
Back to the patch index
Back to the overall index
- Lines: 99
- Date:
Tue Nov 20 15:47:27 2001
- Orig file:
v2.4.14/linux/net/ipv4/ipconfig.c
- Orig date:
Mon Nov 5 15:55:36 2001
diff -u --recursive --new-file v2.4.14/linux/net/ipv4/ipconfig.c linux/net/ipv4/ipconfig.c
@@ -1,5 +1,5 @@
/*
- * $Id: ipconfig.c,v 1.40 2001/10/30 03:08:02 davem Exp $
+ * $Id: ipconfig.c,v 1.42 2001/11/10 07:23:12 davem Exp $
*
* Automatic Configuration of IP -- use DHCP, BOOTP, RARP, or
* user-supplied information to configure own IP address and routes.
@@ -53,6 +53,7 @@
#include <asm/uaccess.h>
#include <asm/checksum.h>
+#include <asm/processor.h>
/* Define this to allow debugging output */
#undef IPCONFIG_DEBUG
@@ -194,8 +195,10 @@
printk(KERN_ERR "IP-Config: Failed to open %s\n", dev->name);
continue;
}
- if (!(d = kmalloc(sizeof(struct ic_device), GFP_KERNEL)))
+ if (!(d = kmalloc(sizeof(struct ic_device), GFP_KERNEL))) {
+ rtnl_shunlock();
return -1;
+ }
d->dev = dev;
*last = d;
last = &d->next;
@@ -605,6 +608,12 @@
*e++ = 17; /* Boot path */
*e++ = 40;
e += 40;
+
+ *e++ = 57; /* set extension buffer size for reply */
+ *e++ = 2;
+ *e++ = 1; /* 128+236+8+20+14, see dhcpd sources */
+ *e++ = 150;
+
*e++ = 255; /* End of the list */
}
@@ -630,7 +639,7 @@
/*
* Send DHCP/BOOTP request to single interface.
*/
-static void __init ic_bootp_send_if(struct ic_device *d, u32 jiffies)
+static void __init ic_bootp_send_if(struct ic_device *d, unsigned long jiffies_diff)
{
struct net_device *dev = d->dev;
struct sk_buff *skb;
@@ -677,7 +686,7 @@
b->your_ip = INADDR_NONE;
b->server_ip = INADDR_NONE;
memcpy(b->hw_addr, dev->dev_addr, dev->addr_len);
- b->secs = htons(jiffies / HZ);
+ b->secs = htons(jiffies_diff / HZ);
b->xid = d->xid;
/* add DHCP options or BOOTP extensions */
@@ -1000,8 +1009,10 @@
#endif
jiff = jiffies + (d->next ? CONF_INTER_TIMEOUT : timeout);
- while (jiffies < jiff && !ic_got_reply)
+ while (time_before(jiffies, jiff) && !ic_got_reply) {
barrier();
+ cpu_relax();
+ }
#ifdef IPCONFIG_DHCP
/* DHCP isn't done until we get a DHCPACK. */
if ((ic_got_reply & IC_BOOTP)
@@ -1113,7 +1124,7 @@
try_try_again:
/* Give hardware a chance to settle */
jiff = jiffies + CONF_PRE_OPEN;
- while (jiffies < jiff)
+ while (time_before(jiffies, jiff))
;
/* Setup all network devices */
@@ -1122,7 +1133,7 @@
/* Give drivers a chance to settle */
jiff = jiffies + CONF_POST_OPEN;
- while (jiffies < jiff)
+ while (time_before(jiffies, jiff))
;
/*
@@ -1133,7 +1144,9 @@
*/
if (ic_myaddr == INADDR_NONE ||
#ifdef CONFIG_ROOT_NFS
- (root_server_addr == INADDR_NONE && ic_servaddr == INADDR_NONE) ||
+ (MAJOR(ROOT_DEV) == UNNAMED_MAJOR
+ && root_server_addr == INADDR_NONE
+ && ic_servaddr == INADDR_NONE) ||
#endif
ic_first_dev->next) {
#ifdef IPCONFIG_DYNAMIC
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)