Skip to content

Commit e573332

Browse files
Vlad Yasevichdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e558b01 commit e573332

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/macvtap.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,11 @@ static int macvtap_forward(struct net_device *dev, struct sk_buff *skb)
290290

291291
skb->dev = dev;
292292
/* Apply the forward feature mask so that we perform segmentation
293-
* according to users wishes.
293+
* according to users wishes. This only works if VNET_HDR is
294+
* enabled.
294295
*/
295-
features |= vlan->tap_features;
296+
if (q->flags & IFF_VNET_HDR)
297+
features |= vlan->tap_features;
296298
if (netif_needs_gso(skb, features)) {
297299
struct sk_buff *segs = __skb_gso_segment(skb, features, false);
298300

0 commit comments

Comments
 (0)