aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 368930a988e..8b500c3e029 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1968,6 +1968,22 @@ static inline void skb_orphan_try(struct sk_buff *skb)
1968 } 1968 }
1969} 1969}
1970 1970
1971int netif_get_vlan_features(struct sk_buff *skb, struct net_device *dev)
1972{
1973 __be16 protocol = skb->protocol;
1974
1975 if (protocol == htons(ETH_P_8021Q)) {
1976 struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;
1977 protocol = veh->h_vlan_encapsulated_proto;
1978 } else if (!skb->vlan_tci)
1979 return dev->features;
1980
1981 if (protocol != htons(ETH_P_8021Q))
1982 return dev->features & dev->vlan_features;
1983 else
1984 return 0;
1985}
1986
1971/* 1987/*
1972 * Returns true if either: 1988 * Returns true if either:
1973 * 1. skb has frag_list and the device doesn't support FRAGLIST, or 1989 * 1. skb has frag_list and the device doesn't support FRAGLIST, or