diff options
Diffstat (limited to 'net/ipv4/ipconfig.c')
-rw-r--r-- | net/ipv4/ipconfig.c | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index 4824fe8996bf..0f42d1c1f690 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c | |||
@@ -292,7 +292,7 @@ static int __init ic_dev_ioctl(unsigned int cmd, struct ifreq *arg) | |||
292 | 292 | ||
293 | mm_segment_t oldfs = get_fs(); | 293 | mm_segment_t oldfs = get_fs(); |
294 | set_fs(get_ds()); | 294 | set_fs(get_ds()); |
295 | res = devinet_ioctl(cmd, (struct ifreq __user *) arg); | 295 | res = devinet_ioctl(&init_net, cmd, (struct ifreq __user *) arg); |
296 | set_fs(oldfs); | 296 | set_fs(oldfs); |
297 | return res; | 297 | return res; |
298 | } | 298 | } |
@@ -376,7 +376,7 @@ static int __init ic_defaults(void) | |||
376 | */ | 376 | */ |
377 | 377 | ||
378 | if (!ic_host_name_set) | 378 | if (!ic_host_name_set) |
379 | sprintf(init_utsname()->nodename, "%u.%u.%u.%u", NIPQUAD(ic_myaddr)); | 379 | sprintf(init_utsname()->nodename, NIPQUAD_FMT, NIPQUAD(ic_myaddr)); |
380 | 380 | ||
381 | if (root_server_addr == NONE) | 381 | if (root_server_addr == NONE) |
382 | root_server_addr = ic_servaddr; | 382 | root_server_addr = ic_servaddr; |
@@ -389,11 +389,11 @@ static int __init ic_defaults(void) | |||
389 | else if (IN_CLASSC(ntohl(ic_myaddr))) | 389 | else if (IN_CLASSC(ntohl(ic_myaddr))) |
390 | ic_netmask = htonl(IN_CLASSC_NET); | 390 | ic_netmask = htonl(IN_CLASSC_NET); |
391 | else { | 391 | else { |
392 | printk(KERN_ERR "IP-Config: Unable to guess netmask for address %u.%u.%u.%u\n", | 392 | printk(KERN_ERR "IP-Config: Unable to guess netmask for address " NIPQUAD_FMT "\n", |
393 | NIPQUAD(ic_myaddr)); | 393 | NIPQUAD(ic_myaddr)); |
394 | return -1; | 394 | return -1; |
395 | } | 395 | } |
396 | printk("IP-Config: Guessing netmask %u.%u.%u.%u\n", NIPQUAD(ic_netmask)); | 396 | printk("IP-Config: Guessing netmask " NIPQUAD_FMT "\n", NIPQUAD(ic_netmask)); |
397 | } | 397 | } |
398 | 398 | ||
399 | return 0; | 399 | return 0; |
@@ -434,7 +434,7 @@ ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt | |||
434 | unsigned char *sha, *tha; /* s for "source", t for "target" */ | 434 | unsigned char *sha, *tha; /* s for "source", t for "target" */ |
435 | struct ic_device *d; | 435 | struct ic_device *d; |
436 | 436 | ||
437 | if (dev->nd_net != &init_net) | 437 | if (dev_net(dev) != &init_net) |
438 | goto drop; | 438 | goto drop; |
439 | 439 | ||
440 | if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) | 440 | if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) |
@@ -460,10 +460,7 @@ ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt | |||
460 | if (rarp->ar_pro != htons(ETH_P_IP)) | 460 | if (rarp->ar_pro != htons(ETH_P_IP)) |
461 | goto drop; | 461 | goto drop; |
462 | 462 | ||
463 | if (!pskb_may_pull(skb, | 463 | if (!pskb_may_pull(skb, arp_hdr_len(dev))) |
464 | sizeof(struct arphdr) + | ||
465 | (2 * dev->addr_len) + | ||
466 | (2 * 4))) | ||
467 | goto drop; | 464 | goto drop; |
468 | 465 | ||
469 | /* OK, it is all there and looks valid, process... */ | 466 | /* OK, it is all there and looks valid, process... */ |
@@ -857,7 +854,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str | |||
857 | struct ic_device *d; | 854 | struct ic_device *d; |
858 | int len, ext_len; | 855 | int len, ext_len; |
859 | 856 | ||
860 | if (dev->nd_net != &init_net) | 857 | if (dev_net(dev) != &init_net) |
861 | goto drop; | 858 | goto drop; |
862 | 859 | ||
863 | /* Perform verifications before taking the lock. */ | 860 | /* Perform verifications before taking the lock. */ |
@@ -984,9 +981,9 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str | |||
984 | ic_myaddr = b->your_ip; | 981 | ic_myaddr = b->your_ip; |
985 | ic_servaddr = server_id; | 982 | ic_servaddr = server_id; |
986 | #ifdef IPCONFIG_DEBUG | 983 | #ifdef IPCONFIG_DEBUG |
987 | printk("DHCP: Offered address %u.%u.%u.%u", | 984 | printk("DHCP: Offered address " NIPQUAD_FMT, |
988 | NIPQUAD(ic_myaddr)); | 985 | NIPQUAD(ic_myaddr)); |
989 | printk(" by server %u.%u.%u.%u\n", | 986 | printk(" by server " NIPQUAD_FMT "\n", |
990 | NIPQUAD(ic_servaddr)); | 987 | NIPQUAD(ic_servaddr)); |
991 | #endif | 988 | #endif |
992 | /* The DHCP indicated server address takes | 989 | /* The DHCP indicated server address takes |
@@ -1182,11 +1179,11 @@ static int __init ic_dynamic(void) | |||
1182 | return -1; | 1179 | return -1; |
1183 | } | 1180 | } |
1184 | 1181 | ||
1185 | printk("IP-Config: Got %s answer from %u.%u.%u.%u, ", | 1182 | printk("IP-Config: Got %s answer from " NIPQUAD_FMT ", ", |
1186 | ((ic_got_reply & IC_RARP) ? "RARP" | 1183 | ((ic_got_reply & IC_RARP) ? "RARP" |
1187 | : (ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP"), | 1184 | : (ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP"), |
1188 | NIPQUAD(ic_servaddr)); | 1185 | NIPQUAD(ic_servaddr)); |
1189 | printk("my address is %u.%u.%u.%u\n", NIPQUAD(ic_myaddr)); | 1186 | printk("my address is " NIPQUAD_FMT "\n", NIPQUAD(ic_myaddr)); |
1190 | 1187 | ||
1191 | return 0; | 1188 | return 0; |
1192 | } | 1189 | } |
@@ -1212,12 +1209,12 @@ static int pnp_seq_show(struct seq_file *seq, void *v) | |||
1212 | for (i = 0; i < CONF_NAMESERVERS_MAX; i++) { | 1209 | for (i = 0; i < CONF_NAMESERVERS_MAX; i++) { |
1213 | if (ic_nameservers[i] != NONE) | 1210 | if (ic_nameservers[i] != NONE) |
1214 | seq_printf(seq, | 1211 | seq_printf(seq, |
1215 | "nameserver %u.%u.%u.%u\n", | 1212 | "nameserver " NIPQUAD_FMT "\n", |
1216 | NIPQUAD(ic_nameservers[i])); | 1213 | NIPQUAD(ic_nameservers[i])); |
1217 | } | 1214 | } |
1218 | if (ic_servaddr != NONE) | 1215 | if (ic_servaddr != NONE) |
1219 | seq_printf(seq, | 1216 | seq_printf(seq, |
1220 | "bootserver %u.%u.%u.%u\n", | 1217 | "bootserver " NIPQUAD_FMT "\n", |
1221 | NIPQUAD(ic_servaddr)); | 1218 | NIPQUAD(ic_servaddr)); |
1222 | return 0; | 1219 | return 0; |
1223 | } | 1220 | } |
@@ -1392,13 +1389,13 @@ static int __init ip_auto_config(void) | |||
1392 | */ | 1389 | */ |
1393 | printk("IP-Config: Complete:"); | 1390 | printk("IP-Config: Complete:"); |
1394 | printk("\n device=%s", ic_dev->name); | 1391 | printk("\n device=%s", ic_dev->name); |
1395 | printk(", addr=%u.%u.%u.%u", NIPQUAD(ic_myaddr)); | 1392 | printk(", addr=" NIPQUAD_FMT, NIPQUAD(ic_myaddr)); |
1396 | printk(", mask=%u.%u.%u.%u", NIPQUAD(ic_netmask)); | 1393 | printk(", mask=" NIPQUAD_FMT, NIPQUAD(ic_netmask)); |
1397 | printk(", gw=%u.%u.%u.%u", NIPQUAD(ic_gateway)); | 1394 | printk(", gw=" NIPQUAD_FMT, NIPQUAD(ic_gateway)); |
1398 | printk(",\n host=%s, domain=%s, nis-domain=%s", | 1395 | printk(",\n host=%s, domain=%s, nis-domain=%s", |
1399 | utsname()->nodename, ic_domain, utsname()->domainname); | 1396 | utsname()->nodename, ic_domain, utsname()->domainname); |
1400 | printk(",\n bootserver=%u.%u.%u.%u", NIPQUAD(ic_servaddr)); | 1397 | printk(",\n bootserver=" NIPQUAD_FMT, NIPQUAD(ic_servaddr)); |
1401 | printk(", rootserver=%u.%u.%u.%u", NIPQUAD(root_server_addr)); | 1398 | printk(", rootserver=" NIPQUAD_FMT, NIPQUAD(root_server_addr)); |
1402 | printk(", rootpath=%s", root_server_path); | 1399 | printk(", rootpath=%s", root_server_path); |
1403 | printk("\n"); | 1400 | printk("\n"); |
1404 | #endif /* !SILENT */ | 1401 | #endif /* !SILENT */ |