diff -urpN --exclude-from=/home/davej/.exclude bk-linus/fs/nfs/nfsroot.c linux-2.5/fs/nfs/nfsroot.c --- bk-linus/fs/nfs/nfsroot.c 2002-11-21 02:20:33.000000000 +0000 +++ linux-2.5/fs/nfs/nfsroot.c 2002-11-21 18:02:25.000000000 +0000 @@ -166,37 +166,6 @@ static struct nfs_bool_opts { /* - * Extract IP address from the parameter string if needed. Note that we - * need to have root_server_addr set _before_ IPConfig gets called as it - * can override it. - */ -static void __init root_nfs_parse_addr(char *name) -{ - int octets = 0; - char *cp, *cq; - - cp = cq = name; - while (octets < 4) { - while (*cp >= '0' && *cp <= '9') - cp++; - if (cp == cq || cp - cq > 3) - break; - if (*cp == '.' || octets == 3) - octets++; - if (octets < 4) - cp++; - cq = cp; - } - if (octets == 4 && (*cp == ':' || *cp == '\0')) { - if (*cp == ':') - *cp++ = '\0'; - root_server_addr = in_aton(name); - strcpy(name, cp); - } -} - - -/* * Parse option string. */ static void __init root_nfs_parse(char *name, char *buf) @@ -348,7 +317,7 @@ int __init nfs_root_setup(char *line) line[sizeof(nfs_root_name) - strlen(NFS_ROOT) - 1] = '\0'; sprintf(nfs_root_name, NFS_ROOT, line); } - root_nfs_parse_addr(nfs_root_name); + root_server_addr = ipconfig_parse_addr(nfs_root_name); return 1; } diff -urpN --exclude-from=/home/davej/.exclude bk-linus/include/net/ipconfig.h linux-2.5/include/net/ipconfig.h --- bk-linus/include/net/ipconfig.h 2002-11-21 02:24:23.000000000 +0000 +++ linux-2.5/include/net/ipconfig.h 2002-11-21 18:05:05.000000000 +0000 @@ -6,6 +6,9 @@ * Automatic IP Layer Configuration */ +#ifndef _NET_IPCONFIG_H +#define _NET_IPCONFIG_H + /* The following are initdata: */ extern int ic_enable; /* Enable or disable the whole shebang */ @@ -36,3 +39,10 @@ extern u8 ic_domain[]; /* DNS (not NIS) #define IC_BOOTP 0x01 /* BOOTP (or DHCP, see below) */ #define IC_RARP 0x02 /* RARP */ #define IC_USE_DHCP 0x100 /* If on, use DHCP instead of BOOTP */ + +#ifdef __KERNEL__ +/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ +extern u32 ipconfig_parse_addr(char *name); /*__init*/ +#endif /* __KERNEL */ + +#endif diff -urpN --exclude-from=/home/davej/.exclude bk-linus/net/ipv4/ipconfig.c linux-2.5/net/ipv4/ipconfig.c --- bk-linus/net/ipv4/ipconfig.c 2002-11-21 02:25:01.000000000 +0000 +++ linux-2.5/net/ipv4/ipconfig.c 2002-11-21 18:05:34.000000000 +0000 @@ -27,7 +27,7 @@ * Merged changes from 2.2.19 into 2.4.3 * -- Eric Biederman , 22 April Aug 2001 * - * Multipe Nameservers in /proc/net/pnp + * Multiple Nameservers in /proc/net/pnp * -- Josef Siemes , Aug 2002 */ @@ -1128,12 +1128,47 @@ static int pnp_get_info(char *buffer, ch #endif /* CONFIG_PROC_FS */ /* + * Extract IP address from the parameter string if needed. Note that we + * need to have root_server_addr set _before_ IPConfig gets called as it + * can override it. + */ +u32 __init ipconfig_parse_addr(char *name) +{ + u32 addr; + int octets = 0; + char *cp, *cq; + + cp = cq = name; + while (octets < 4) { + while (*cp >= '0' && *cp <= '9') + cp++; + if (cp == cq || cp - cq > 3) + break; + if (*cp == '.' || octets == 3) + octets++; + if (octets < 4) + cp++; + cq = cp; + } + if (octets == 4 && (*cp == ':' || *cp == '\0')) { + if (*cp == ':') + *cp++ = '\0'; + addr = in_aton(name); + strcpy(name, cp); + } else + addr = INADDR_NONE; + + return addr; +} + +/* * IP Autoconfig dispatcher. */ static int __init ip_auto_config(void) { unsigned long jiff; + u32 addr; #ifdef CONFIG_PROC_FS proc_net_create("pnp", 0, pnp_get_info); @@ -1222,6 +1257,10 @@ static int __init ip_auto_config(void) ic_dev = ic_first_dev->dev; } + addr = ipconfig_parse_addr(root_server_path); + if (root_server_addr == INADDR_NONE) + root_server_addr = addr; + /* * Use defaults whereever applicable. */