From: Jiri Pirko Date: Wed, 19 Nov 2014 13:04:55 +0000 (+0100) Subject: openvswitch: actions: use skb_postpull_rcsum when possible X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1abcd82c20e7cbfd2b89d834b24ff68feae158ec;p=linux-beck.git openvswitch: actions: use skb_postpull_rcsum when possible Replace duplicated code by calling skb_postpull_rcsum Suggested-by: Eric Dumazet Signed-off-by: Jiri Pirko Acked-by: Pravin B Shelar Acked-by: Simon Horman Signed-off-by: David S. Miller --- diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c index 394efa67934e..749a30163071 100644 --- a/net/openvswitch/actions.c +++ b/net/openvswitch/actions.c @@ -175,10 +175,7 @@ static int pop_mpls(struct sk_buff *skb, struct sw_flow_key *key, if (unlikely(err)) return err; - if (skb->ip_summed == CHECKSUM_COMPLETE) - skb->csum = csum_sub(skb->csum, - csum_partial(skb_mpls_header(skb), - MPLS_HLEN, 0)); + skb_postpull_rcsum(skb, skb_mpls_header(skb), MPLS_HLEN); memmove(skb_mac_header(skb) + MPLS_HLEN, skb_mac_header(skb), skb->mac_len); @@ -230,9 +227,7 @@ static int __pop_vlan_tci(struct sk_buff *skb, __be16 *current_tci) if (unlikely(err)) return err; - if (skb->ip_summed == CHECKSUM_COMPLETE) - skb->csum = csum_sub(skb->csum, csum_partial(skb->data - + (2 * ETH_ALEN), VLAN_HLEN, 0)); + skb_postpull_rcsum(skb, skb->data + (2 * ETH_ALEN), VLAN_HLEN); vhdr = (struct vlan_hdr *)(skb->data + ETH_HLEN); *current_tci = vhdr->h_vlan_TCI;