fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / net / ipv4 / ipconfig.c
index a5322ad..afa60b9 100644 (file)
@@ -31,7 +31,6 @@
  *              --  Josef Siemes <jsiemes@web.de>, Aug 2002
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
@@ -42,6 +41,7 @@
 #include <linux/in.h>
 #include <linux/if.h>
 #include <linux/inet.h>
+#include <linux/inetdevice.h>
 #include <linux/netdevice.h>
 #include <linux/if_arp.h>
 #include <linux/skbuff.h>
 #include <linux/seq_file.h>
 #include <linux/major.h>
 #include <linux/root_dev.h>
+#include <linux/delay.h>
+#include <linux/nfs_fs.h>
 #include <net/arp.h>
 #include <net/ip.h>
 #include <net/ipconfig.h>
+#include <net/route.h>
 
 #include <asm/uaccess.h>
 #include <net/checksum.h>
@@ -84,8 +87,8 @@
 #endif
 
 /* Define the friendly delay before and after opening net devices */
-#define CONF_PRE_OPEN          (HZ/2)  /* Before opening: 1/2 second */
-#define CONF_POST_OPEN         (1*HZ)  /* After opening: 1 second */
+#define CONF_PRE_OPEN          500     /* Before opening: 1/2 second */
+#define CONF_POST_OPEN         1       /* After opening: 1 second */
 
 /* Define the timeout for waiting for a DHCP/BOOTP/RARP reply */
 #define CONF_OPEN_RETRIES      2       /* (Re)open devices twice */
 #define CONF_NAMESERVERS_MAX   3       /* Maximum number of nameservers  
                                            - '3' from resolv.h */
 
+#define NONE __constant_htonl(INADDR_NONE)
 
 /*
  * Public IP configuration
  */
 int ic_set_manually __initdata = 0;            /* IPconfig parameters set manually */
 
-int ic_enable __initdata = 0;                  /* IP config enabled? */
+static int ic_enable __initdata = 0;           /* IP config enabled? */
 
 /* Protocol choice */
 int ic_proto_enabled __initdata = 0
@@ -124,22 +128,22 @@ int ic_proto_enabled __initdata = 0
 #endif
                        ;
 
-int ic_host_name_set __initdata = 0;           /* Host name set by us? */
+static int ic_host_name_set __initdata = 0;    /* Host name set by us? */
 
-u32 ic_myaddr = INADDR_NONE;           /* My IP address */
-u32 ic_netmask = INADDR_NONE;  /* Netmask for local subnet */
-u32 ic_gateway = INADDR_NONE;  /* Gateway IP address */
+__be32 ic_myaddr = NONE;               /* My IP address */
+static __be32 ic_netmask = NONE;       /* Netmask for local subnet */
+__be32 ic_gateway = NONE;      /* Gateway IP address */
 
-u32 ic_servaddr = INADDR_NONE; /* Boot server IP address */
+__be32 ic_servaddr = NONE;     /* Boot server IP address */
 
-u32 root_server_addr = INADDR_NONE;    /* Address of NFS server */
+__be32 root_server_addr = NONE;        /* Address of NFS server */
 u8 root_server_path[256] = { 0, };     /* Path to mount as root */
 
 /* Persistent data: */
 
-int ic_proto_used;                     /* Protocol used, if any */
-u32 ic_nameservers[CONF_NAMESERVERS_MAX]; /* DNS Server IP addresses */
-u8 ic_domain[64];              /* DNS (not NIS) domain name */
+static int ic_proto_used;                      /* Protocol used, if any */
+static __be32 ic_nameservers[CONF_NAMESERVERS_MAX]; /* DNS Server IP addresses */
+static u8 ic_domain[64];               /* DNS (not NIS) domain name */
 
 /*
  * Private state.
@@ -152,7 +156,7 @@ static char user_dev_name[IFNAMSIZ] __initdata = { 0, };
 static int ic_proto_have_if __initdata = 0;
 
 #ifdef IPCONFIG_DYNAMIC
-static spinlock_t ic_recv_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(ic_recv_lock);
 static volatile int ic_got_reply __initdata = 0;    /* Proto(s) that replied */
 #endif
 #ifdef IPCONFIG_DHCP
@@ -169,7 +173,7 @@ struct ic_device {
        struct net_device *dev;
        unsigned short flags;
        short able;
-       u32 xid;
+       __be32 xid;
 };
 
 static struct ic_device *ic_first_dev __initdata = NULL;/* List of open device */
@@ -182,8 +186,15 @@ static int __init ic_open_devs(void)
        unsigned short oflags;
 
        last = &ic_first_dev;
-       rtnl_shlock();
+       rtnl_lock();
+
+       /* bring loopback device up first */
+       if (dev_change_flags(&loopback_dev, loopback_dev.flags | IFF_UP) < 0)
+               printk(KERN_ERR "IP-Config: Failed to open %s\n", loopback_dev.name);
+
        for (dev = dev_base; dev; dev = dev->next) {
+               if (dev == &loopback_dev)
+                       continue;
                if (user_dev_name[0] ? !strcmp(dev->name, user_dev_name) :
                    (!(dev->flags & IFF_LOOPBACK) &&
                     (dev->flags & (IFF_POINTOPOINT|IFF_BROADCAST)) &&
@@ -204,7 +215,7 @@ static int __init ic_open_devs(void)
                                continue;
                        }
                        if (!(d = kmalloc(sizeof(struct ic_device), GFP_KERNEL))) {
-                               rtnl_shunlock();
+                               rtnl_unlock();
                                return -1;
                        }
                        d->dev = dev;
@@ -213,7 +224,7 @@ static int __init ic_open_devs(void)
                        d->flags = oflags;
                        d->able = able;
                        if (able & IC_BOOTP)
-                               get_random_bytes(&d->xid, sizeof(u32));
+                               get_random_bytes(&d->xid, sizeof(__be32));
                        else
                                d->xid = 0;
                        ic_proto_have_if |= able;
@@ -221,7 +232,7 @@ static int __init ic_open_devs(void)
                                dev->name, able, d->xid));
                }
        }
-       rtnl_shunlock();
+       rtnl_unlock();
 
        *last = NULL;
 
@@ -240,7 +251,7 @@ static void __init ic_close_devs(void)
        struct ic_device *d, *next;
        struct net_device *dev;
 
-       rtnl_shlock();
+       rtnl_lock();
        next = ic_first_dev;
        while ((d = next)) {
                next = d->next;
@@ -251,7 +262,7 @@ static void __init ic_close_devs(void)
                }
                kfree(d);
        }
-       rtnl_shunlock();
+       rtnl_unlock();
 }
 
 /*
@@ -259,7 +270,7 @@ static void __init ic_close_devs(void)
  */
 
 static inline void
-set_sockaddr(struct sockaddr_in *sin, u32 addr, u16 port)
+set_sockaddr(struct sockaddr_in *sin, __be32 addr, __be16 port)
 {
        sin->sin_family = AF_INET;
        sin->sin_addr.s_addr = addr;
@@ -272,7 +283,7 @@ static int __init ic_dev_ioctl(unsigned int cmd, struct ifreq *arg)
 
        mm_segment_t oldfs = get_fs();
        set_fs(get_ds());
-       res = devinet_ioctl(cmd, arg);
+       res = devinet_ioctl(cmd, (struct ifreq __user *) arg);
        set_fs(oldfs);
        return res;
 }
@@ -283,7 +294,7 @@ static int __init ic_route_ioctl(unsigned int cmd, struct rtentry *arg)
 
        mm_segment_t oldfs = get_fs();
        set_fs(get_ds());
-       res = ip_rt_ioctl(cmd, arg);
+       res = ip_rt_ioctl(cmd, (void __user *) arg);
        set_fs(oldfs);
        return res;
 }
@@ -322,7 +333,7 @@ static int __init ic_setup_routes(void)
 {
        /* No need to setup device routes, only the default route... */
 
-       if (ic_gateway != INADDR_NONE) {
+       if (ic_gateway != NONE) {
                struct rtentry rm;
                int err;
 
@@ -356,12 +367,12 @@ static int __init ic_defaults(void)
         */
         
        if (!ic_host_name_set)
-               sprintf(system_utsname.nodename, "%u.%u.%u.%u", NIPQUAD(ic_myaddr));
+               sprintf(init_utsname()->nodename, "%u.%u.%u.%u", NIPQUAD(ic_myaddr));
 
-       if (root_server_addr == INADDR_NONE)
+       if (root_server_addr == NONE)
                root_server_addr = ic_servaddr;
 
-       if (ic_netmask == INADDR_NONE) {
+       if (ic_netmask == NONE) {
                if (IN_CLASSA(ntohl(ic_myaddr)))
                        ic_netmask = htonl(IN_CLASSA_NET);
                else if (IN_CLASSB(ntohl(ic_myaddr)))
@@ -385,7 +396,7 @@ static int __init ic_defaults(void)
 
 #ifdef IPCONFIG_RARP
 
-static int ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt);
+static int ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev);
 
 static struct packet_type rarp_packet_type __initdata = {
        .type = __constant_htons(ETH_P_RARP),
@@ -406,11 +417,11 @@ static inline void ic_rarp_cleanup(void)
  *  Process received RARP packet.
  */
 static int __init
-ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
+ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
 {
        struct arphdr *rarp;
        unsigned char *rarp_ptr;
-       unsigned long sip, tip;
+       __be32 sip, tip;
        unsigned char *sha, *tha;               /* s for "source", t for "target" */
        struct ic_device *d;
 
@@ -475,12 +486,12 @@ ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
                goto drop_unlock;
 
        /* Discard packets which are not from specified server. */
-       if (ic_servaddr != INADDR_NONE && ic_servaddr != sip)
+       if (ic_servaddr != NONE && ic_servaddr != sip)
                goto drop_unlock;
 
        /* We have a winner! */
        ic_dev = dev;
-       if (ic_myaddr == INADDR_NONE)
+       if (ic_myaddr == NONE)
                ic_myaddr = tip;
        ic_servaddr = sip;
        ic_got_reply = IC_RARP;
@@ -520,13 +531,13 @@ struct bootp_pkt {                /* BOOTP packet format */
        u8 htype;               /* HW address type */
        u8 hlen;                /* HW address length */
        u8 hops;                /* Used only by gateways */
-       u32 xid;                /* Transaction ID */
-       u16 secs;               /* Seconds since we started */
-       u16 flags;              /* Just what it says */
-       u32 client_ip;          /* Client's IP address if known */
-       u32 your_ip;            /* Assigned IP address */
-       u32 server_ip;          /* (Next, e.g. NFS) Server's IP address */
-       u32 relay_ip;           /* IP address of BOOTP relay */
+       __be32 xid;             /* Transaction ID */
+       __be16 secs;            /* Seconds since we started */
+       __be16 flags;           /* Just what it says */
+       __be32 client_ip;               /* Client's IP address if known */
+       __be32 your_ip;         /* Assigned IP address */
+       __be32 server_ip;               /* (Next, e.g. NFS) Server's IP address */
+       __be32 relay_ip;                /* IP address of BOOTP relay */
        u8 hw_addr[16];         /* Client's HW address */
        u8 serv_name[64];       /* Server host name */
        u8 boot_file[128];      /* Name of boot file */
@@ -547,7 +558,7 @@ struct bootp_pkt {          /* BOOTP packet format */
 #define DHCPRELEASE    7
 #define DHCPINFORM     8
 
-static int ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt);
+static int ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev);
 
 static struct packet_type bootp_packet_type __initdata = {
        .type = __constant_htons(ETH_P_IP),
@@ -566,7 +577,7 @@ static const u8 ic_bootp_cookie[4] = { 99, 130, 83, 99 };
 static void __init
 ic_dhcp_init_options(u8 *options)
 {
-       u8 mt = ((ic_servaddr == INADDR_NONE)
+       u8 mt = ((ic_servaddr == NONE)
                 ? DHCPDISCOVER : DHCPREQUEST);
        u8 *e = options;
 
@@ -656,7 +667,7 @@ static inline void ic_bootp_init(void)
        int i;
 
        for (i = 0; i < CONF_NAMESERVERS_MAX; i++)
-               ic_nameservers[i] = INADDR_NONE;
+               ic_nameservers[i] = NONE;
 
        dev_add_pack(&bootp_packet_type);
 }
@@ -698,7 +709,7 @@ static void __init ic_bootp_send_if(struct ic_device *d, unsigned long jiffies_d
        h->frag_off = htons(IP_DF);
        h->ttl = 64;
        h->protocol = IPPROTO_UDP;
-       h->daddr = INADDR_BROADCAST;
+       h->daddr = htonl(INADDR_BROADCAST);
        h->check = ip_fast_csum((unsigned char *) h, h->ihl);
 
        /* Construct UDP header */
@@ -713,13 +724,15 @@ static void __init ic_bootp_send_if(struct ic_device *d, unsigned long jiffies_d
                b->htype = dev->type;
        else if (dev->type == ARPHRD_IEEE802_TR) /* fix for token ring */
                b->htype = ARPHRD_IEEE802;
+       else if (dev->type == ARPHRD_FDDI)
+               b->htype = ARPHRD_ETHER;
        else {
                printk("Unknown ARP type 0x%04x for device %s\n", dev->type, dev->name);
                b->htype = dev->type; /* can cause undefined behavior */
        }
        b->hlen = dev->addr_len;
-       b->your_ip = INADDR_NONE;
-       b->server_ip = INADDR_NONE;
+       b->your_ip = NONE;
+       b->server_ip = NONE;
        memcpy(b->hw_addr, dev->dev_addr, dev->addr_len);
        b->secs = htons(jiffies_diff / HZ);
        b->xid = d->xid;
@@ -776,11 +789,11 @@ static void __init ic_do_bootp_ext(u8 *ext)
 
        switch (*ext++) {
                case 1:         /* Subnet mask */
-                       if (ic_netmask == INADDR_NONE)
+                       if (ic_netmask == NONE)
                                memcpy(&ic_netmask, ext+1, 4);
                        break;
                case 3:         /* Default gateway */
-                       if (ic_gateway == INADDR_NONE)
+                       if (ic_gateway == NONE)
                                memcpy(&ic_gateway, ext+1, 4);
                        break;
                case 6:         /* DNS server */
@@ -788,12 +801,12 @@ static void __init ic_do_bootp_ext(u8 *ext)
                        if (servers > CONF_NAMESERVERS_MAX)
                                servers = CONF_NAMESERVERS_MAX;
                        for (i = 0; i < servers; i++) {
-                               if (ic_nameservers[i] == INADDR_NONE)
+                               if (ic_nameservers[i] == NONE)
                                        memcpy(&ic_nameservers[i], ext+1+4*i, 4);
                        }
                        break;
                case 12:        /* Host name */
-                       ic_bootp_string(system_utsname.nodename, ext+1, *ext, __NEW_UTS_LEN);
+                       ic_bootp_string(utsname()->nodename, ext+1, *ext, __NEW_UTS_LEN);
                        ic_host_name_set = 1;
                        break;
                case 15:        /* Domain name (DNS) */
@@ -804,7 +817,7 @@ static void __init ic_do_bootp_ext(u8 *ext)
                                ic_bootp_string(root_server_path, ext+1, *ext, sizeof(root_server_path));
                        break;
                case 40:        /* NIS Domain name (_not_ DNS) */
-                       ic_bootp_string(system_utsname.domainname, ext+1, *ext, __NEW_UTS_LEN);
+                       ic_bootp_string(utsname()->domainname, ext+1, *ext, __NEW_UTS_LEN);
                        break;
        }
 }
@@ -813,12 +826,12 @@ static void __init ic_do_bootp_ext(u8 *ext)
 /*
  *  Receive BOOTP reply.
  */
-static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
+static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
 {
        struct bootp_pkt *b;
        struct iphdr *h;
        struct ic_device *d;
-       int len;
+       int len, ext_len;
 
        /* Perform verifications before taking the lock.  */
        if (skb->pkt_type == PACKET_OTHERHOST)
@@ -859,7 +872,11 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str
                goto drop;
 
        len = ntohs(b->udph.len) - sizeof(struct udphdr);
-       if (len < 300)
+       ext_len = len - (sizeof(*b) -
+                        sizeof(struct iphdr) -
+                        sizeof(struct udphdr) -
+                        sizeof(b->exten));
+       if (ext_len < 0)
                goto drop;
 
        /* Ok the front looks good, make sure we can get at the rest.  */
@@ -894,13 +911,14 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str
        }
 
        /* Parse extensions */
-       if (!memcmp(b->exten, ic_bootp_cookie, 4)) { /* Check magic cookie */
+       if (ext_len >= 4 &&
+           !memcmp(b->exten, ic_bootp_cookie, 4)) { /* Check magic cookie */
                 u8 *end = (u8 *) b + ntohs(b->iph.tot_len);
                u8 *ext;
 
 #ifdef IPCONFIG_DHCP
                if (ic_proto_enabled & IC_USE_DHCP) {
-                       u32 server_id = INADDR_NONE;
+                       __be32 server_id = NONE;
                        int mt = 0;
 
                        ext = &b->exten[4];
@@ -932,7 +950,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str
                                /* While in the process of accepting one offer,
                                 * ignore all others.
                                 */
-                               if (ic_myaddr != INADDR_NONE)
+                               if (ic_myaddr != NONE)
                                        goto drop_unlock;
 
                                /* Let's accept that offer. */
@@ -948,19 +966,22 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str
                                 * precedence over the bootp header one if
                                 * they are different.
                                 */
-                               if ((server_id != INADDR_NONE) &&
+                               if ((server_id != NONE) &&
                                    (b->server_ip != server_id))
                                        b->server_ip = ic_servaddr;
                                break;
 
                        case DHCPACK:
+                               if (memcmp(dev->dev_addr, b->hw_addr, dev->addr_len) != 0)
+                                       goto drop_unlock;
+
                                /* Yeah! */
                                break;
 
                        default:
                                /* Urque.  Forget it*/
-                               ic_myaddr = INADDR_NONE;
-                               ic_servaddr = INADDR_NONE;
+                               ic_myaddr = NONE;
+                               ic_servaddr = NONE;
                                goto drop_unlock;
                        };
 
@@ -984,9 +1005,9 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str
        ic_dev = dev;
        ic_myaddr = b->your_ip;
        ic_servaddr = b->server_ip;
-       if (ic_gateway == INADDR_NONE && b->relay_ip)
+       if (ic_gateway == NONE && b->relay_ip)
                ic_gateway = b->relay_ip;
-       if (ic_nameservers[0] == INADDR_NONE)
+       if (ic_nameservers[0] == NONE)
                ic_nameservers[0] = ic_servaddr;
        ic_got_reply = IC_BOOTP;
 
@@ -1084,10 +1105,8 @@ static int __init ic_dynamic(void)
 #endif
 
                jiff = jiffies + (d->next ? CONF_INTER_TIMEOUT : timeout);
-               while (time_before(jiffies, jiff) && !ic_got_reply) {
-                       barrier();
-                       cpu_relax();
-               }
+               while (time_before(jiffies, jiff) && !ic_got_reply)
+                       schedule_timeout_uninterruptible(1);
 #ifdef IPCONFIG_DHCP
                /* DHCP isn't done until we get a DHCPACK. */
                if ((ic_got_reply & IC_BOOTP)
@@ -1131,8 +1150,10 @@ static int __init ic_dynamic(void)
                ic_rarp_cleanup();
 #endif
 
-       if (!ic_got_reply)
+       if (!ic_got_reply) {
+               ic_myaddr = NONE;
                return -1;
+       }
 
        printk("IP-Config: Got %s answer from %u.%u.%u.%u, ",
                ((ic_got_reply & IC_RARP) ? "RARP" 
@@ -1162,12 +1183,12 @@ static int pnp_seq_show(struct seq_file *seq, void *v)
                seq_printf(seq,
                           "domain %s\n", ic_domain);
        for (i = 0; i < CONF_NAMESERVERS_MAX; i++) {
-               if (ic_nameservers[i] != INADDR_NONE)
+               if (ic_nameservers[i] != NONE)
                        seq_printf(seq,
                                   "nameserver %u.%u.%u.%u\n",
                                   NIPQUAD(ic_nameservers[i]));
        }
-       if (ic_servaddr != INADDR_NONE)
+       if (ic_servaddr != NONE)
                seq_printf(seq,
                           "bootserver %u.%u.%u.%u\n",
                           NIPQUAD(ic_servaddr));
@@ -1193,9 +1214,9 @@ static struct file_operations pnp_seq_fops = {
  *  need to have root_server_addr set _before_ IPConfig gets called as it
  *  can override it.
  */
-u32 __init root_nfs_parse_addr(char *name)
+__be32 __init root_nfs_parse_addr(char *name)
 {
-       u32 addr;
+       __be32 addr;
        int octets = 0;
        char *cp, *cq;
 
@@ -1215,9 +1236,9 @@ u32 __init root_nfs_parse_addr(char *name)
                if (*cp == ':')
                        *cp++ = '\0';
                addr = in_aton(name);
-               strcpy(name, cp);
+               memmove(name, cp, strlen(cp) + 1);
        } else
-               addr = INADDR_NONE;
+               addr = NONE;
 
        return addr;
 }
@@ -1228,8 +1249,7 @@ u32 __init root_nfs_parse_addr(char *name)
 
 static int __init ip_auto_config(void)
 {
-       unsigned long jiff;
-       u32 addr;
+       __be32 addr;
 
 #ifdef CONFIG_PROC_FS
        proc_net_fops_create("pnp", S_IRUGO, &pnp_seq_fops);
@@ -1243,18 +1263,14 @@ static int __init ip_auto_config(void)
  try_try_again:
 #endif
        /* Give hardware a chance to settle */
-       jiff = jiffies + CONF_PRE_OPEN;
-       while (time_before(jiffies, jiff))
-               cpu_relax();
+       msleep(CONF_PRE_OPEN);
 
        /* Setup all network devices */
        if (ic_open_devs() < 0)
                return -1;
 
        /* Give drivers a chance to settle */
-       jiff = jiffies + CONF_POST_OPEN;
-       while (time_before(jiffies, jiff))
-               cpu_relax();
+       ssleep(CONF_POST_OPEN);
 
        /*
         * If the config information is insufficient (e.g., our IP address or
@@ -1262,11 +1278,11 @@ static int __init ip_auto_config(void)
         * interfaces and no default was set), use BOOTP or RARP to get the
         * missing values.
         */
-       if (ic_myaddr == INADDR_NONE ||
+       if (ic_myaddr == NONE ||
 #ifdef CONFIG_ROOT_NFS
            (MAJOR(ROOT_DEV) == UNNAMED_MAJOR
-            && root_server_addr == INADDR_NONE
-            && ic_servaddr == INADDR_NONE) ||
+            && root_server_addr == NONE
+            && ic_servaddr == NONE) ||
 #endif
            ic_first_dev->next) {
 #ifdef IPCONFIG_DYNAMIC
@@ -1319,7 +1335,7 @@ static int __init ip_auto_config(void)
        }
 
        addr = root_nfs_parse_addr(root_server_path);
-       if (root_server_addr == INADDR_NONE)
+       if (root_server_addr == NONE)
                root_server_addr = addr;
 
        /*
@@ -1353,7 +1369,7 @@ static int __init ip_auto_config(void)
        printk(", mask=%u.%u.%u.%u", NIPQUAD(ic_netmask));
        printk(", gw=%u.%u.%u.%u", NIPQUAD(ic_gateway));
        printk(",\n     host=%s, domain=%s, nis-domain=%s",
-              system_utsname.nodename, ic_domain, system_utsname.domainname);
+              utsname()->nodename, ic_domain, utsname()->domainname);
        printk(",\n     bootserver=%u.%u.%u.%u", NIPQUAD(ic_servaddr));
        printk(", rootserver=%u.%u.%u.%u", NIPQUAD(root_server_addr));
        printk(", rootpath=%s", root_server_path);
@@ -1446,28 +1462,28 @@ static int __init ip_auto_config_setup(char *addrs)
                        switch (num) {
                        case 0:
                                if ((ic_myaddr = in_aton(ip)) == INADDR_ANY)
-                                       ic_myaddr = INADDR_NONE;
+                                       ic_myaddr = NONE;
                                break;
                        case 1:
                                if ((ic_servaddr = in_aton(ip)) == INADDR_ANY)
-                                       ic_servaddr = INADDR_NONE;
+                                       ic_servaddr = NONE;
                                break;
                        case 2:
                                if ((ic_gateway = in_aton(ip)) == INADDR_ANY)
-                                       ic_gateway = INADDR_NONE;
+                                       ic_gateway = NONE;
                                break;
                        case 3:
                                if ((ic_netmask = in_aton(ip)) == INADDR_ANY)
-                                       ic_netmask = INADDR_NONE;
+                                       ic_netmask = NONE;
                                break;
                        case 4:
                                if ((dp = strchr(ip, '.'))) {
                                        *dp++ = '\0';
-                                       strlcpy(system_utsname.domainname, dp,
-                                               sizeof(system_utsname.domainname));
+                                       strlcpy(utsname()->domainname, dp,
+                                               sizeof(utsname()->domainname));
                                }
-                               strlcpy(system_utsname.nodename, ip,
-                                       sizeof(system_utsname.nodename));
+                               strlcpy(utsname()->nodename, ip,
+                                       sizeof(utsname()->nodename));
                                ic_host_name_set = 1;
                                break;
                        case 5: