[SK_BUFF]: Introduce arp_hdr(), remove skb->nh.arph
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
fd74e6ccd5
commit
d0a92be05e
@@ -2524,7 +2524,7 @@ static int bond_arp_rcv(struct sk_buff *skb, struct net_device *dev, struct pack
|
|||||||
(2 * sizeof(u32)))))
|
(2 * sizeof(u32)))))
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
|
|
||||||
arp = skb->nh.arph;
|
arp = arp_hdr(skb);
|
||||||
if (arp->ar_hln != dev->addr_len ||
|
if (arp->ar_hln != dev->addr_len ||
|
||||||
skb->pkt_type == PACKET_OTHERHOST ||
|
skb->pkt_type == PACKET_OTHERHOST ||
|
||||||
skb->pkt_type == PACKET_LOOPBACK ||
|
skb->pkt_type == PACKET_LOOPBACK ||
|
||||||
|
@@ -1925,7 +1925,7 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||||||
*/
|
*/
|
||||||
if ((unlikely(!adapter->sge->espibug_skb[dev->if_port]))) {
|
if ((unlikely(!adapter->sge->espibug_skb[dev->if_port]))) {
|
||||||
if (skb->protocol == htons(ETH_P_ARP) &&
|
if (skb->protocol == htons(ETH_P_ARP) &&
|
||||||
skb->nh.arph->ar_op == htons(ARPOP_REQUEST)) {
|
arp_hdr(skb)->ar_op == htons(ARPOP_REQUEST)) {
|
||||||
adapter->sge->espibug_skb[dev->if_port] = skb;
|
adapter->sge->espibug_skb[dev->if_port] = skb;
|
||||||
/* We want to re-use this skb later. We
|
/* We want to re-use this skb later. We
|
||||||
* simply bump the reference count and it
|
* simply bump the reference count and it
|
||||||
|
@@ -148,4 +148,13 @@ struct arphdr
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef __KERNEL__
|
||||||
|
#include <linux/skbuff.h>
|
||||||
|
|
||||||
|
static inline struct arphdr *arp_hdr(const struct sk_buff *skb)
|
||||||
|
{
|
||||||
|
return (struct arphdr *)skb_network_header(skb);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* _LINUX_IF_ARP_H */
|
#endif /* _LINUX_IF_ARP_H */
|
||||||
|
@@ -248,7 +248,6 @@ struct sk_buff {
|
|||||||
|
|
||||||
union {
|
union {
|
||||||
struct ipv6hdr *ipv6h;
|
struct ipv6hdr *ipv6h;
|
||||||
struct arphdr *arph;
|
|
||||||
unsigned char *raw;
|
unsigned char *raw;
|
||||||
} nh;
|
} nh;
|
||||||
|
|
||||||
|
@@ -670,7 +670,7 @@ static unsigned int br_nf_forward_arp(unsigned int hook, struct sk_buff **pskb,
|
|||||||
(*pskb)->nh.raw += VLAN_HLEN;
|
(*pskb)->nh.raw += VLAN_HLEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (skb->nh.arph->ar_pln != 4) {
|
if (arp_hdr(skb)->ar_pln != 4) {
|
||||||
if (IS_VLAN_ARP(skb)) {
|
if (IS_VLAN_ARP(skb)) {
|
||||||
skb_push(*pskb, VLAN_HLEN);
|
skb_push(*pskb, VLAN_HLEN);
|
||||||
(*pskb)->nh.raw -= VLAN_HLEN;
|
(*pskb)->nh.raw -= VLAN_HLEN;
|
||||||
|
@@ -363,7 +363,7 @@ static void arp_reply(struct sk_buff *skb)
|
|||||||
|
|
||||||
skb_reset_network_header(skb);
|
skb_reset_network_header(skb);
|
||||||
skb->h.raw = skb->data;
|
skb->h.raw = skb->data;
|
||||||
arp = skb->nh.arph;
|
arp = arp_hdr(skb);
|
||||||
|
|
||||||
if ((arp->ar_hrd != htons(ARPHRD_ETHER) &&
|
if ((arp->ar_hrd != htons(ARPHRD_ETHER) &&
|
||||||
arp->ar_hrd != htons(ARPHRD_IEEE802)) ||
|
arp->ar_hrd != htons(ARPHRD_IEEE802)) ||
|
||||||
|
@@ -721,7 +721,7 @@ static int arp_process(struct sk_buff *skb)
|
|||||||
if (in_dev == NULL)
|
if (in_dev == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
arp = skb->nh.arph;
|
arp = arp_hdr(skb);
|
||||||
|
|
||||||
switch (dev_type) {
|
switch (dev_type) {
|
||||||
default:
|
default:
|
||||||
@@ -937,7 +937,7 @@ static int arp_rcv(struct sk_buff *skb, struct net_device *dev,
|
|||||||
(2 * sizeof(u32)))))
|
(2 * sizeof(u32)))))
|
||||||
goto freeskb;
|
goto freeskb;
|
||||||
|
|
||||||
arp = skb->nh.arph;
|
arp = arp_hdr(skb);
|
||||||
if (arp->ar_hln != dev->addr_len ||
|
if (arp->ar_hln != dev->addr_len ||
|
||||||
dev->flags & IFF_NOARP ||
|
dev->flags & IFF_NOARP ||
|
||||||
skb->pkt_type == PACKET_OTHERHOST ||
|
skb->pkt_type == PACKET_OTHERHOST ||
|
||||||
|
@@ -245,7 +245,7 @@ unsigned int arpt_do_table(struct sk_buff **pskb,
|
|||||||
e = get_entry(table_base, private->hook_entry[hook]);
|
e = get_entry(table_base, private->hook_entry[hook]);
|
||||||
back = get_entry(table_base, private->underflow[hook]);
|
back = get_entry(table_base, private->underflow[hook]);
|
||||||
|
|
||||||
arp = (*pskb)->nh.arph;
|
arp = arp_hdr(*pskb);
|
||||||
do {
|
do {
|
||||||
if (arp_packet_match(arp, (*pskb)->dev, indev, outdev, &e->arp)) {
|
if (arp_packet_match(arp, (*pskb)->dev, indev, outdev, &e->arp)) {
|
||||||
struct arpt_entry_target *t;
|
struct arpt_entry_target *t;
|
||||||
@@ -297,7 +297,7 @@ unsigned int arpt_do_table(struct sk_buff **pskb,
|
|||||||
t->data);
|
t->data);
|
||||||
|
|
||||||
/* Target might have changed stuff. */
|
/* Target might have changed stuff. */
|
||||||
arp = (*pskb)->nh.arph;
|
arp = arp_hdr(*pskb);
|
||||||
|
|
||||||
if (verdict == ARPT_CONTINUE)
|
if (verdict == ARPT_CONTINUE)
|
||||||
e = (void *)e + e->next_offset;
|
e = (void *)e + e->next_offset;
|
||||||
|
@@ -30,7 +30,7 @@ target(struct sk_buff **pskb,
|
|||||||
*pskb = nskb;
|
*pskb = nskb;
|
||||||
}
|
}
|
||||||
|
|
||||||
arp = (*pskb)->nh.arph;
|
arp = arp_hdr(*pskb);
|
||||||
arpptr = skb_network_header(*pskb) + sizeof(*arp);
|
arpptr = skb_network_header(*pskb) + sizeof(*arp);
|
||||||
pln = arp->ar_pln;
|
pln = arp->ar_pln;
|
||||||
hln = arp->ar_hln;
|
hln = arp->ar_hln;
|
||||||
|
@@ -521,7 +521,7 @@ arp_mangle(unsigned int hook,
|
|||||||
const struct net_device *out,
|
const struct net_device *out,
|
||||||
int (*okfn)(struct sk_buff *))
|
int (*okfn)(struct sk_buff *))
|
||||||
{
|
{
|
||||||
struct arphdr *arp = (*pskb)->nh.arph;
|
struct arphdr *arp = arp_hdr(*pskb);
|
||||||
struct arp_payload *payload;
|
struct arp_payload *payload;
|
||||||
struct clusterip_config *c;
|
struct clusterip_config *c;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user