diff options
Diffstat (limited to 'net/ipv4/ipconfig.c')
-rw-r--r-- | net/ipv4/ipconfig.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index cf49de1a4983..597c800b2fdc 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c | |||
@@ -432,7 +432,7 @@ ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt | |||
432 | goto drop; | 432 | goto drop; |
433 | 433 | ||
434 | /* Basic sanity checks can be done without the lock. */ | 434 | /* Basic sanity checks can be done without the lock. */ |
435 | rarp = (struct arphdr *)skb->h.raw; | 435 | rarp = (struct arphdr *)skb_transport_header(skb); |
436 | 436 | ||
437 | /* If this test doesn't pass, it's not IP, or we should | 437 | /* If this test doesn't pass, it's not IP, or we should |
438 | * ignore it anyway. | 438 | * ignore it anyway. |
@@ -455,7 +455,7 @@ ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt | |||
455 | goto drop; | 455 | goto drop; |
456 | 456 | ||
457 | /* OK, it is all there and looks valid, process... */ | 457 | /* OK, it is all there and looks valid, process... */ |
458 | rarp = (struct arphdr *)skb->h.raw; | 458 | rarp = (struct arphdr *)skb_transport_header(skb); |
459 | rarp_ptr = (unsigned char *) (rarp + 1); | 459 | rarp_ptr = (unsigned char *) (rarp + 1); |
460 | 460 | ||
461 | /* One reply at a time, please. */ | 461 | /* One reply at a time, please. */ |
@@ -702,7 +702,8 @@ static void __init ic_bootp_send_if(struct ic_device *d, unsigned long jiffies_d | |||
702 | memset(b, 0, sizeof(struct bootp_pkt)); | 702 | memset(b, 0, sizeof(struct bootp_pkt)); |
703 | 703 | ||
704 | /* Construct IP header */ | 704 | /* Construct IP header */ |
705 | skb->nh.iph = h = &b->iph; | 705 | skb_reset_network_header(skb); |
706 | h = ip_hdr(skb); | ||
706 | h->version = 4; | 707 | h->version = 4; |
707 | h->ihl = 5; | 708 | h->ihl = 5; |
708 | h->tot_len = htons(sizeof(struct bootp_pkt)); | 709 | h->tot_len = htons(sizeof(struct bootp_pkt)); |
@@ -782,7 +783,7 @@ static void __init ic_do_bootp_ext(u8 *ext) | |||
782 | u8 *c; | 783 | u8 *c; |
783 | 784 | ||
784 | printk("DHCP/BOOTP: Got extension %d:",*ext); | 785 | printk("DHCP/BOOTP: Got extension %d:",*ext); |
785 | for(c=ext+2; c<ext+2+ext[1]; c++) | 786 | for (c=ext+2; c<ext+2+ext[1]; c++) |
786 | printk(" %02x", *c); | 787 | printk(" %02x", *c); |
787 | printk("\n"); | 788 | printk("\n"); |
788 | #endif | 789 | #endif |
@@ -845,7 +846,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str | |||
845 | sizeof(struct udphdr))) | 846 | sizeof(struct udphdr))) |
846 | goto drop; | 847 | goto drop; |
847 | 848 | ||
848 | b = (struct bootp_pkt *) skb->nh.iph; | 849 | b = (struct bootp_pkt *)skb_network_header(skb); |
849 | h = &b->iph; | 850 | h = &b->iph; |
850 | 851 | ||
851 | if (h->ihl != 5 || h->version != 4 || h->protocol != IPPROTO_UDP) | 852 | if (h->ihl != 5 || h->version != 4 || h->protocol != IPPROTO_UDP) |
@@ -883,7 +884,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str | |||
883 | if (!pskb_may_pull(skb, skb->len)) | 884 | if (!pskb_may_pull(skb, skb->len)) |
884 | goto drop; | 885 | goto drop; |
885 | 886 | ||
886 | b = (struct bootp_pkt *) skb->nh.iph; | 887 | b = (struct bootp_pkt *)skb_network_header(skb); |
887 | h = &b->iph; | 888 | h = &b->iph; |
888 | 889 | ||
889 | /* One reply at a time, please. */ | 890 | /* One reply at a time, please. */ |
@@ -938,7 +939,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str | |||
938 | if (opt[1] >= 4) | 939 | if (opt[1] >= 4) |
939 | memcpy(&server_id, opt + 2, 4); | 940 | memcpy(&server_id, opt + 2, 4); |
940 | break; | 941 | break; |
941 | }; | 942 | } |
942 | } | 943 | } |
943 | 944 | ||
944 | #ifdef IPCONFIG_DEBUG | 945 | #ifdef IPCONFIG_DEBUG |
@@ -983,7 +984,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str | |||
983 | ic_myaddr = NONE; | 984 | ic_myaddr = NONE; |
984 | ic_servaddr = NONE; | 985 | ic_servaddr = NONE; |
985 | goto drop_unlock; | 986 | goto drop_unlock; |
986 | }; | 987 | } |
987 | 988 | ||
988 | ic_dhcp_msgtype = mt; | 989 | ic_dhcp_msgtype = mt; |
989 | 990 | ||
@@ -1094,7 +1095,7 @@ static int __init ic_dynamic(void) | |||
1094 | retries = CONF_SEND_RETRIES; | 1095 | retries = CONF_SEND_RETRIES; |
1095 | get_random_bytes(&timeout, sizeof(timeout)); | 1096 | get_random_bytes(&timeout, sizeof(timeout)); |
1096 | timeout = CONF_BASE_TIMEOUT + (timeout % (unsigned) CONF_TIMEOUT_RANDOM); | 1097 | timeout = CONF_BASE_TIMEOUT + (timeout % (unsigned) CONF_TIMEOUT_RANDOM); |
1097 | for(;;) { | 1098 | for (;;) { |
1098 | #ifdef IPCONFIG_BOOTP | 1099 | #ifdef IPCONFIG_BOOTP |
1099 | if (do_bootp && (d->able & IC_BOOTP)) | 1100 | if (do_bootp && (d->able & IC_BOOTP)) |
1100 | ic_bootp_send_if(d, jiffies - start_jiffies); | 1101 | ic_bootp_send_if(d, jiffies - start_jiffies); |