aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2006-03-21 01:43:56 -0500
committerDavid S. Miller <davem@davemloft.net>2006-03-21 01:43:56 -0500
commitcbb042f9e1292434e3cacb90e67d8d381aeac5a9 (patch)
treecc42f42232e56b68111cfebdc175197d8607bdd7 /net/bridge
parentecba320f2e95c9a0c35011d1ecb1db4419980536 (diff)
[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>
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/br_netfilter.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index e060aad8624d..6787bc5197f7 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -425,8 +425,7 @@ static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff **pskb,
425 425
426 if (skb->protocol == __constant_htons(ETH_P_8021Q)) { 426 if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
427 u8 *vhdr = skb->data; 427 u8 *vhdr = skb->data;
428 skb_pull(skb, VLAN_HLEN); 428 skb_pull_rcsum(skb, VLAN_HLEN);
429 skb_postpull_rcsum(skb, vhdr, VLAN_HLEN);
430 skb->nh.raw += VLAN_HLEN; 429 skb->nh.raw += VLAN_HLEN;
431 } 430 }
432 return br_nf_pre_routing_ipv6(hook, skb, in, out, okfn); 431 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,
444 443
445 if (skb->protocol == __constant_htons(ETH_P_8021Q)) { 444 if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
446 u8 *vhdr = skb->data; 445 u8 *vhdr = skb->data;
447 skb_pull(skb, VLAN_HLEN); 446 skb_pull_rcsum(skb, VLAN_HLEN);
448 skb_postpull_rcsum(skb, vhdr, VLAN_HLEN);
449 skb->nh.raw += VLAN_HLEN; 447 skb->nh.raw += VLAN_HLEN;
450 } 448 }
451 449