aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/arp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/arp.c')
-rw-r--r--net/ipv4/arp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 1a3488a83f49..7110779a0244 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -342,13 +342,13 @@ static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb)
342 switch (IN_DEV_ARP_ANNOUNCE(in_dev)) { 342 switch (IN_DEV_ARP_ANNOUNCE(in_dev)) {
343 default: 343 default:
344 case 0: /* By default announce any local IP */ 344 case 0: /* By default announce any local IP */
345 if (skb && inet_addr_type(skb->nh.iph->saddr) == RTN_LOCAL) 345 if (skb && inet_addr_type(ip_hdr(skb)->saddr) == RTN_LOCAL)
346 saddr = skb->nh.iph->saddr; 346 saddr = ip_hdr(skb)->saddr;
347 break; 347 break;
348 case 1: /* Restrict announcements of saddr in same subnet */ 348 case 1: /* Restrict announcements of saddr in same subnet */
349 if (!skb) 349 if (!skb)
350 break; 350 break;
351 saddr = skb->nh.iph->saddr; 351 saddr = ip_hdr(skb)->saddr;
352 if (inet_addr_type(saddr) == RTN_LOCAL) { 352 if (inet_addr_type(saddr) == RTN_LOCAL) {
353 /* saddr should be known to target */ 353 /* saddr should be known to target */
354 if (inet_addr_onlink(in_dev, target, saddr)) 354 if (inet_addr_onlink(in_dev, target, saddr))
@@ -578,7 +578,7 @@ struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
578 return NULL; 578 return NULL;
579 579
580 skb_reserve(skb, LL_RESERVED_SPACE(dev)); 580 skb_reserve(skb, LL_RESERVED_SPACE(dev));
581 skb->nh.raw = skb->data; 581 skb_reset_network_header(skb);
582 arp = (struct arphdr *) skb_put(skb,sizeof(struct arphdr) + 2*(dev->addr_len+4)); 582 arp = (struct arphdr *) skb_put(skb,sizeof(struct arphdr) + 2*(dev->addr_len+4));
583 skb->dev = dev; 583 skb->dev = dev;
584 skb->protocol = htons(ETH_P_ARP); 584 skb->protocol = htons(ETH_P_ARP);
@@ -721,7 +721,7 @@ static int arp_process(struct sk_buff *skb)
721 if (in_dev == NULL) 721 if (in_dev == NULL)
722 goto out; 722 goto out;
723 723
724 arp = skb->nh.arph; 724 arp = arp_hdr(skb);
725 725
726 switch (dev_type) { 726 switch (dev_type) {
727 default: 727 default:
@@ -937,7 +937,7 @@ static int arp_rcv(struct sk_buff *skb, struct net_device *dev,
937 (2 * sizeof(u32))))) 937 (2 * sizeof(u32)))))
938 goto freeskb; 938 goto freeskb;
939 939
940 arp = skb->nh.arph; 940 arp = arp_hdr(skb);
941 if (arp->ar_hln != dev->addr_len || 941 if (arp->ar_hln != dev->addr_len ||
942 dev->flags & IFF_NOARP || 942 dev->flags & IFF_NOARP ||
943 skb->pkt_type == PACKET_OTHERHOST || 943 skb->pkt_type == PACKET_OTHERHOST ||
@@ -1178,7 +1178,7 @@ int arp_ioctl(unsigned int cmd, void __user *arg)
1178 goto out; 1178 goto out;
1179 } 1179 }
1180 1180
1181 switch(cmd) { 1181 switch (cmd) {
1182 case SIOCDARP: 1182 case SIOCDARP:
1183 err = arp_req_delete(&r, dev); 1183 err = arp_req_delete(&r, dev);
1184 break; 1184 break;
@@ -1360,7 +1360,7 @@ static void *arp_seq_start(struct seq_file *seq, loff_t *pos)
1360 1360
1361/* ------------------------------------------------------------------------ */ 1361/* ------------------------------------------------------------------------ */
1362 1362
1363static struct seq_operations arp_seq_ops = { 1363static const struct seq_operations arp_seq_ops = {
1364 .start = arp_seq_start, 1364 .start = arp_seq_start,
1365 .next = neigh_seq_next, 1365 .next = neigh_seq_next,
1366 .stop = neigh_seq_stop, 1366 .stop = neigh_seq_stop,