This is a note to let you know that I've just added the patch titled
net: fix ETHTOOL_SFEATURES compatibility with old ethtool_ops.set_flags
to the 2.6.39-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
net-fix-ethtool_sfeatures-compatibility-with-old-ethtool_ops.set_flags.patch
and it can be found in the queue-2.6.39 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From 30357d1cec07320f46627db61889f885f3688458 Mon Sep 17 00:00:00 2001
From: MichaÅ MirosÅaw <[email protected]>
Date: Thu, 26 May 2011 00:42:57 +0000
Subject: net: fix ETHTOOL_SFEATURES compatibility with old ethtool_ops.set_flags
From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= <[email protected]>
[ Upstream commit fd0daf9d58f6b3342d07c5f6bbfb304dbe5db4ec ]
Current code squashes flags to bool - this makes set_flags fail whenever
some ETH_FLAG_* equivalent features are set. Fix this.
Signed-off-by: Micha©© Miros©©aw <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
net/core/ethtool.c | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -231,6 +231,29 @@ static int ethtool_set_feature_compat(st
return 1;
}
+static int ethtool_set_flags_compat(struct net_device *dev,
+ int (*legacy_set)(struct net_device *, u32),
+ struct ethtool_set_features_block *features, u32 mask)
+{
+ u32 value;
+
+ if (!legacy_set)
+ return 0;
+
+ if (!(features[0].valid & mask))
+ return 0;
+
+ value = dev->features & ~features[0].valid;
+ value |= features[0].requested;
+
+ features[0].valid &= ~mask;
+
+ if (legacy_set(dev, value & mask) < 0)
+ netdev_info(dev, "Legacy flags change failed\n");
+
+ return 1;
+}
+
static int ethtool_set_features_compat(struct net_device *dev,
struct ethtool_set_features_block *features)
{
@@ -247,7 +270,7 @@ static int ethtool_set_features_compat(s
features, NETIF_F_ALL_TSO);
compat |= ethtool_set_feature_compat(dev, dev->ethtool_ops->set_rx_csum,
features, NETIF_F_RXCSUM);
- compat |= ethtool_set_feature_compat(dev, dev->ethtool_ops->set_flags,
+ compat |= ethtool_set_flags_compat(dev, dev->ethtool_ops->set_flags,
features, flags_dup_features);
return compat;
Patches currently in stable-queue which might be from [email protected]
are
queue-2.6.39/net-fix-ethtool_sfeatures-compatibility-with-old-ethtool_ops.set_flags.patch
_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable