Skip to content

Commit 5f8dc33

Browse files
Nikolay Aleksandrovdavem330
authored andcommitted
net: fix feature changes on devices without ndo_set_features
When __netdev_update_features() was updated to ensure some features are disabled on new lower devices, an error was introduced for devices which don't have the ndo_set_features() method set. Before we'll just set the new features, but now we return an error and don't set them. Fix this by returning the old behaviour and setting err to 0 when ndo_set_features is not present. Fixes: e7868a8 ("net/core: ensure features get disabled on new lower devs") CC: Jarod Wilson <[email protected]> CC: Jiri Pirko <[email protected]> CC: Ido Schimmel <[email protected]> CC: Sander Eikelenboom <[email protected]> CC: Andy Gospodarek <[email protected]> CC: Florian Fainelli <[email protected]> Signed-off-by: Nikolay Aleksandrov <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Reviewed-by: Andy Gospodarek <[email protected]> Reviewed-by: Jarod Wilson <[email protected]> Tested-by: Florian Fainelli <[email protected]> Tested-by: Dave Young <[email protected]> Tested-by: Christian Borntraeger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent bbe14f5 commit 5f8dc33

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/core/dev.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6426,6 +6426,8 @@ int __netdev_update_features(struct net_device *dev)
64266426

64276427
if (dev->netdev_ops->ndo_set_features)
64286428
err = dev->netdev_ops->ndo_set_features(dev, features);
6429+
else
6430+
err = 0;
64296431

64306432
if (unlikely(err < 0)) {
64316433
netdev_err(dev,

0 commit comments

Comments
 (0)