summaryrefslogtreecommitdiffstats
path: root/drivers/net/macvtap.c
diff options
context:
space:
mode:
authorVlad Yasevich <vyasevic@redhat.com>2013-08-16 15:25:02 -0400
committerDavid S. Miller <davem@davemloft.net>2013-08-20 13:09:12 -0700
commite5733321d5a94cc9a202ea85c4aabe09571217e6 (patch)
tree015082f759ea15c94ccce946e9c173d213e50b36 /drivers/net/macvtap.c
parente558b0188bb7e35ffc4d35253c6b9ea491f3b996 (diff)
downloadlinux-e5733321d5a94cc9a202ea85c4aabe09571217e6.tar.gz
linux-e5733321d5a94cc9a202ea85c4aabe09571217e6.tar.bz2
linux-e5733321d5a94cc9a202ea85c4aabe09571217e6.zip
macvtap: Ignore tap features when VNET_HDR is off
When the user turns off VNET_HDR support on the macvtap device, there is no way to provide any offload information to the user. So, it's safer to ignore offload setting then depend on the user setting them correctly. Signed-off-by: Vlad Yasevich <vyasevic@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/macvtap.c')
-rw-r--r--drivers/net/macvtap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 4acfbce63a7d..ea53abb20988 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -290,9 +290,11 @@ static int macvtap_forward(struct net_device *dev, struct sk_buff *skb)
skb->dev = dev;
/* Apply the forward feature mask so that we perform segmentation
- * according to users wishes.
+ * according to users wishes. This only works if VNET_HDR is
+ * enabled.
*/
- features |= vlan->tap_features;
+ if (q->flags & IFF_VNET_HDR)
+ features |= vlan->tap_features;
if (netif_needs_gso(skb, features)) {
struct sk_buff *segs = __skb_gso_segment(skb, features, false);