[NET]: Replace skb_pull/skb_postpull_rcsum with skb_pull_rcsum
We're now starting to have quite a number of places that do skb_pull followed immediately by an skb_postpull_rcsum. We can merge these two operations into one function with skb_pull_rcsum. This makes sense since most pull operations on receive skb's need to update the checksum. I've decided to make this out-of-line since it is fairly big and the fast path where hardware checksums are enabled need to call csum_partial anyway. Since this is a brand new function we get to add an extra check on the len argument. As it is most callers of skb_pull ignore its return value which essentially means that there is no check on the len argument. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
ecba320f2e
commit
cbb042f9e1
@@ -425,8 +425,7 @@ static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff **pskb,
|
||||
|
||||
if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
|
||||
u8 *vhdr = skb->data;
|
||||
skb_pull(skb, VLAN_HLEN);
|
||||
skb_postpull_rcsum(skb, vhdr, VLAN_HLEN);
|
||||
skb_pull_rcsum(skb, VLAN_HLEN);
|
||||
skb->nh.raw += VLAN_HLEN;
|
||||
}
|
||||
return br_nf_pre_routing_ipv6(hook, skb, in, out, okfn);
|
||||
@@ -444,8 +443,7 @@ static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff **pskb,
|
||||
|
||||
if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
|
||||
u8 *vhdr = skb->data;
|
||||
skb_pull(skb, VLAN_HLEN);
|
||||
skb_postpull_rcsum(skb, vhdr, VLAN_HLEN);
|
||||
skb_pull_rcsum(skb, VLAN_HLEN);
|
||||
skb->nh.raw += VLAN_HLEN;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user