Commit f0a619cc authored by Michał Mirosław's avatar Michał Mirosław Committed by David S. Miller

net: Fix vlan_features propagation

Fix VLAN features propagation for devices which change vlan_features.
For this to work, driver needs to make sure netdev_features_changed()
gets called after the change (it is e.g. after ndo_set_features()).

Side effect is that a user might request features that will never
be enabled on a VLAN device.
Signed-off-by: default avatarMichał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 864b5418
...@@ -528,7 +528,7 @@ static int vlan_dev_init(struct net_device *dev) ...@@ -528,7 +528,7 @@ static int vlan_dev_init(struct net_device *dev)
(1<<__LINK_STATE_DORMANT))) | (1<<__LINK_STATE_DORMANT))) |
(1<<__LINK_STATE_PRESENT); (1<<__LINK_STATE_PRESENT);
dev->hw_features = real_dev->vlan_features & NETIF_F_ALL_TX_OFFLOADS; dev->hw_features = NETIF_F_ALL_TX_OFFLOADS;
dev->features |= real_dev->vlan_features | NETIF_F_LLTX; dev->features |= real_dev->vlan_features | NETIF_F_LLTX;
dev->gso_max_size = real_dev->gso_max_size; dev->gso_max_size = real_dev->gso_max_size;
...@@ -587,9 +587,11 @@ static u32 vlan_dev_fix_features(struct net_device *dev, u32 features) ...@@ -587,9 +587,11 @@ static u32 vlan_dev_fix_features(struct net_device *dev, u32 features)
{ {
struct net_device *real_dev = vlan_dev_info(dev)->real_dev; struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
features &= (real_dev->features | NETIF_F_LLTX); features &= real_dev->features;
features &= real_dev->vlan_features;
if (dev_ethtool_get_rx_csum(real_dev)) if (dev_ethtool_get_rx_csum(real_dev))
features |= NETIF_F_RXCSUM; features |= NETIF_F_RXCSUM;
features |= NETIF_F_LLTX;
return features; return features;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment