Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218452
b: refs/heads/master
c: af1905d
h: refs/heads/master
v: v3
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Oct 27, 2010
1 parent 724a6f3 commit be38d3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cd0ea2419544cfc4ccbf8ee0087d0d9f109852d2
refs/heads/master: af1905dbec44445d75851996819ac2203670bd0f
16 changes: 6 additions & 10 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit be38d3f

Please sign in to comment.