From be38d3f15fec2bed80168e1e60b378d11a63b922 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 22 Oct 2010 04:12:19 +0000 Subject: [PATCH] --- yaml --- r: 218452 b: refs/heads/master c: af1905dbec44445d75851996819ac2203670bd0f h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/core/dev.c | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index f526970cc9c4..3a31b0146246 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cd0ea2419544cfc4ccbf8ee0087d0d9f109852d2 +refs/heads/master: af1905dbec44445d75851996819ac2203670bd0f diff --git a/trunk/net/core/dev.c b/trunk/net/core/dev.c index e8a8dc19365b..3c5fbfbb3181 100644 --- a/trunk/net/core/dev.c +++ b/trunk/net/core/dev.c @@ -1696,22 +1696,18 @@ static bool can_checksum_protocol(unsigned long features, __be16 protocol) static bool dev_can_checksum(struct net_device *dev, struct sk_buff *skb) { + __be16 protocol = skb->protocol; int features = dev->features; - if (vlan_tx_tag_present(skb)) + if (vlan_tx_tag_present(skb)) { features &= dev->vlan_features; - - if (can_checksum_protocol(features, skb->protocol)) - return true; - - if (skb->protocol == htons(ETH_P_8021Q)) { + } else if (protocol == htons(ETH_P_8021Q)) { struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data; - if (can_checksum_protocol(dev->features & dev->vlan_features, - veh->h_vlan_encapsulated_proto)) - return true; + protocol = veh->h_vlan_encapsulated_proto; + features &= dev->vlan_features; } - return false; + return can_checksum_protocol(features, protocol); } /**