aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/bonding/bond_main.c2
-rw-r--r--drivers/net/chelsio/sge.c2
-rw-r--r--include/linux/if_arp.h9
-rw-r--r--include/linux/skbuff.h1
-rw-r--r--net/bridge/br_netfilter.c2
-rw-r--r--net/core/netpoll.c2
-rw-r--r--net/ipv4/arp.c4
-rw-r--r--net/ipv4/netfilter/arp_tables.c4
-rw-r--r--net/ipv4/netfilter/arpt_mangle.c2
-rw-r--r--net/ipv4/netfilter/ipt_CLUSTERIP.c2
10 files changed, 19 insertions, 11 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 7f11388893fc..76d3504505bd 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2524,7 +2524,7 @@ static int bond_arp_rcv(struct sk_buff *skb, struct net_device *dev, struct pack
2524 (2 * sizeof(u32))))) 2524 (2 * sizeof(u32)))))
2525 goto out_unlock; 2525 goto out_unlock;
2526 2526
2527 arp = skb->nh.arph; 2527 arp = arp_hdr(skb);
2528 if (arp->ar_hln != dev->addr_len || 2528 if (arp->ar_hln != dev->addr_len ||
2529 skb->pkt_type == PACKET_OTHERHOST || 2529 skb->pkt_type == PACKET_OTHERHOST ||
2530 skb->pkt_type == PACKET_LOOPBACK || 2530 skb->pkt_type == PACKET_LOOPBACK ||
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c
index c357f45a16c3..a4204dff3636 100644
--- a/drivers/net/chelsio/sge.c
+++ b/drivers/net/chelsio/sge.c
@@ -1925,7 +1925,7 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev)
1925 */ 1925 */
1926 if ((unlikely(!adapter->sge->espibug_skb[dev->if_port]))) { 1926 if ((unlikely(!adapter->sge->espibug_skb[dev->if_port]))) {
1927 if (skb->protocol == htons(ETH_P_ARP) && 1927 if (skb->protocol == htons(ETH_P_ARP) &&
1928 skb->nh.arph->ar_op == htons(ARPOP_REQUEST)) { 1928 arp_hdr(skb)->ar_op == htons(ARPOP_REQUEST)) {
1929 adapter->sge->espibug_skb[dev->if_port] = skb; 1929 adapter->sge->espibug_skb[dev->if_port] = skb;
1930 /* We want to re-use this skb later. We 1930 /* We want to re-use this skb later. We
1931 * simply bump the reference count and it 1931 * simply bump the reference count and it
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h
index 7f5714214ee3..ed7b93c3083a 100644
--- a/include/linux/if_arp.h
+++ b/include/linux/if_arp.h
@@ -148,4 +148,13 @@ struct arphdr
148 148
149}; 149};
150 150
151#ifdef __KERNEL__
152#include <linux/skbuff.h>
153
154static inline struct arphdr *arp_hdr(const struct sk_buff *skb)
155{
156 return (struct arphdr *)skb_network_header(skb);
157}
158#endif
159
151#endif /* _LINUX_IF_ARP_H */ 160#endif /* _LINUX_IF_ARP_H */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 62f841b5b700..9cb674b12b29 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -248,7 +248,6 @@ struct sk_buff {
248 248
249 union { 249 union {
250 struct ipv6hdr *ipv6h; 250 struct ipv6hdr *ipv6h;
251 struct arphdr *arph;
252 unsigned char *raw; 251 unsigned char *raw;
253 } nh; 252 } nh;
254 253
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index ebe740f6b902..0ee74b1e4770 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -670,7 +670,7 @@ static unsigned int br_nf_forward_arp(unsigned int hook, struct sk_buff **pskb,
670 (*pskb)->nh.raw += VLAN_HLEN; 670 (*pskb)->nh.raw += VLAN_HLEN;
671 } 671 }
672 672
673 if (skb->nh.arph->ar_pln != 4) { 673 if (arp_hdr(skb)->ar_pln != 4) {
674 if (IS_VLAN_ARP(skb)) { 674 if (IS_VLAN_ARP(skb)) {
675 skb_push(*pskb, VLAN_HLEN); 675 skb_push(*pskb, VLAN_HLEN);
676 (*pskb)->nh.raw -= VLAN_HLEN; 676 (*pskb)->nh.raw -= VLAN_HLEN;
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index c4cec17be334..496b06244a8e 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -363,7 +363,7 @@ static void arp_reply(struct sk_buff *skb)
363 363
364 skb_reset_network_header(skb); 364 skb_reset_network_header(skb);
365 skb->h.raw = skb->data; 365 skb->h.raw = skb->data;
366 arp = skb->nh.arph; 366 arp = arp_hdr(skb);
367 367
368 if ((arp->ar_hrd != htons(ARPHRD_ETHER) && 368 if ((arp->ar_hrd != htons(ARPHRD_ETHER) &&
369 arp->ar_hrd != htons(ARPHRD_IEEE802)) || 369 arp->ar_hrd != htons(ARPHRD_IEEE802)) ||
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 01d0e8dd17d8..7110779a0244 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -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 ||
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
index 57b0221f9e24..cae41215e3c7 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -245,7 +245,7 @@ unsigned int arpt_do_table(struct sk_buff **pskb,
245 e = get_entry(table_base, private->hook_entry[hook]); 245 e = get_entry(table_base, private->hook_entry[hook]);
246 back = get_entry(table_base, private->underflow[hook]); 246 back = get_entry(table_base, private->underflow[hook]);
247 247
248 arp = (*pskb)->nh.arph; 248 arp = arp_hdr(*pskb);
249 do { 249 do {
250 if (arp_packet_match(arp, (*pskb)->dev, indev, outdev, &e->arp)) { 250 if (arp_packet_match(arp, (*pskb)->dev, indev, outdev, &e->arp)) {
251 struct arpt_entry_target *t; 251 struct arpt_entry_target *t;
@@ -297,7 +297,7 @@ unsigned int arpt_do_table(struct sk_buff **pskb,
297 t->data); 297 t->data);
298 298
299 /* Target might have changed stuff. */ 299 /* Target might have changed stuff. */
300 arp = (*pskb)->nh.arph; 300 arp = arp_hdr(*pskb);
301 301
302 if (verdict == ARPT_CONTINUE) 302 if (verdict == ARPT_CONTINUE)
303 e = (void *)e + e->next_offset; 303 e = (void *)e + e->next_offset;
diff --git a/net/ipv4/netfilter/arpt_mangle.c b/net/ipv4/netfilter/arpt_mangle.c
index af1c8593eb19..b4450f1ccc1b 100644
--- a/net/ipv4/netfilter/arpt_mangle.c
+++ b/net/ipv4/netfilter/arpt_mangle.c
@@ -30,7 +30,7 @@ target(struct sk_buff **pskb,
30 *pskb = nskb; 30 *pskb = nskb;
31 } 31 }
32 32
33 arp = (*pskb)->nh.arph; 33 arp = arp_hdr(*pskb);
34 arpptr = skb_network_header(*pskb) + sizeof(*arp); 34 arpptr = skb_network_header(*pskb) + sizeof(*arp);
35 pln = arp->ar_pln; 35 pln = arp->ar_pln;
36 hln = arp->ar_hln; 36 hln = arp->ar_hln;
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
index af5b82b8ceb7..d3b16817a991 100644
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -521,7 +521,7 @@ arp_mangle(unsigned int hook,
521 const struct net_device *out, 521 const struct net_device *out,
522 int (*okfn)(struct sk_buff *)) 522 int (*okfn)(struct sk_buff *))
523{ 523{
524 struct arphdr *arp = (*pskb)->nh.arph; 524 struct arphdr *arp = arp_hdr(*pskb);
525 struct arp_payload *payload; 525 struct arp_payload *payload;
526 struct clusterip_config *c; 526 struct clusterip_config *c;
527 527