Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224156
b: refs/heads/master
c: 58e998c
h: refs/heads/master
v: v3
  • Loading branch information
Jesse Gross authored and David S. Miller committed Nov 15, 2010
1 parent 31366ef commit 0011754
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 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: c8d5bcd1aff89199cde4bd82c5c40fb704c8bba4
refs/heads/master: 58e998c6d23988490162cef0784b19ea274d90bb
7 changes: 3 additions & 4 deletions trunk/include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -2239,6 +2239,8 @@ unsigned long netdev_fix_features(unsigned long features, const char *name);
void netif_stacked_transfer_operstate(const struct net_device *rootdev,
struct net_device *dev);

int netif_get_vlan_features(struct sk_buff *skb, struct net_device *dev);

static inline int net_gso_ok(int features, int gso_type)
{
int feature = gso_type << NETIF_F_GSO_SHIFT;
Expand All @@ -2254,10 +2256,7 @@ static inline int skb_gso_ok(struct sk_buff *skb, int features)
static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
{
if (skb_is_gso(skb)) {
int features = dev->features;

if (skb->protocol == htons(ETH_P_8021Q) || skb->vlan_tci)
features &= dev->vlan_features;
int features = netif_get_vlan_features(skb, dev);

return (!skb_gso_ok(skb, features) ||
unlikely(skb->ip_summed != CHECKSUM_PARTIAL));
Expand Down
16 changes: 16 additions & 0 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1968,6 +1968,22 @@ static inline void skb_orphan_try(struct sk_buff *skb)
}
}

int netif_get_vlan_features(struct sk_buff *skb, struct net_device *dev)
{
__be16 protocol = skb->protocol;

if (protocol == htons(ETH_P_8021Q)) {
struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;
protocol = veh->h_vlan_encapsulated_proto;
} else if (!skb->vlan_tci)
return dev->features;

if (protocol != htons(ETH_P_8021Q))
return dev->features & dev->vlan_features;
else
return 0;
}

/*
* Returns true if either:
* 1. skb has frag_list and the device doesn't support FRAGLIST, or
Expand Down

0 comments on commit 0011754

Please sign in to comment.