Skip to content

Commit 17b85d2

Browse files
Nikolay Aleksandrovdavem330
authored andcommitted
net/core: revert "net: fix __netdev_update_features return.." and add comment
This reverts commit 00ee592 ("net: fix __netdev_update_features return on ndo_set_features failure") and adds a comment explaining why it's okay to return a value other than 0 upon error. Some drivers might actually change flags and return an error so it's better to fire a spurious notification rather than miss these. CC: Michał Mirosław <[email protected]> Signed-off-by: Nikolay Aleksandrov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a3a116e commit 17b85d2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/core/dev.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6436,7 +6436,10 @@ int __netdev_update_features(struct net_device *dev)
64366436
netdev_err(dev,
64376437
"set_features() failed (%d); wanted %pNF, left %pNF\n",
64386438
err, &features, &dev->features);
6439-
return 0;
6439+
/* return non-0 since some features might have changed and
6440+
* it's better to fire a spurious notification than miss it
6441+
*/
6442+
return -1;
64406443
}
64416444

64426445
sync_lower:

0 commit comments

Comments
 (0)