Skip to contentSkip to conversation

net/core: revert "net: fix __netdev_update_features return.." and add comment

PATCH In review Lorenzo Colitti 1 participant 2 messages Nov 18, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/4 net/core: revert "net: fix __netdev_update_features return.." and add comment

From: Nikolay Aleksandrov <[email protected]>

This reverts commit 00ee59271777 ("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.

---
 net/core/dev.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
net/core/dev.c +4 -1
index 5dbc86e..ae00b89 100644
@@ -6436,7 +6436,10 @@ int __netdev_update_features(struct net_device *dev)
 		netdev_err(dev,
 			"set_features() failed (%d); wanted %pNF, left %pNF\n",
 			err, &features, &dev->features);
-		return 0;
+		/* return non-0 since some features might have changed and
+		 * it's better to fire a spurious notification than miss it
+		 */
+		return -1;
 	}
 
 sync_lower:
Signature · 1 line
2.6.0.rc2.230.g3dd15c0