diff options
-rw-r--r-- | net/core/ethtool.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 66cdc76770ce..69a3edc182f9 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
@@ -168,6 +168,18 @@ EXPORT_SYMBOL(ethtool_ntuple_flush); | |||
168 | 168 | ||
169 | #define ETHTOOL_DEV_FEATURE_WORDS 1 | 169 | #define ETHTOOL_DEV_FEATURE_WORDS 1 |
170 | 170 | ||
171 | static void ethtool_get_features_compat(struct net_device *dev, | ||
172 | struct ethtool_get_features_block *features) | ||
173 | { | ||
174 | if (!dev->ethtool_ops) | ||
175 | return; | ||
176 | |||
177 | /* getting RX checksum */ | ||
178 | if (dev->ethtool_ops->get_rx_csum) | ||
179 | if (dev->ethtool_ops->get_rx_csum(dev)) | ||
180 | features[0].active |= NETIF_F_RXCSUM; | ||
181 | } | ||
182 | |||
171 | static int ethtool_get_features(struct net_device *dev, void __user *useraddr) | 183 | static int ethtool_get_features(struct net_device *dev, void __user *useraddr) |
172 | { | 184 | { |
173 | struct ethtool_gfeatures cmd = { | 185 | struct ethtool_gfeatures cmd = { |
@@ -185,6 +197,8 @@ static int ethtool_get_features(struct net_device *dev, void __user *useraddr) | |||
185 | u32 __user *sizeaddr; | 197 | u32 __user *sizeaddr; |
186 | u32 copy_size; | 198 | u32 copy_size; |
187 | 199 | ||
200 | ethtool_get_features_compat(dev, features); | ||
201 | |||
188 | sizeaddr = useraddr + offsetof(struct ethtool_gfeatures, size); | 202 | sizeaddr = useraddr + offsetof(struct ethtool_gfeatures, size); |
189 | if (get_user(copy_size, sizeaddr)) | 203 | if (get_user(copy_size, sizeaddr)) |
190 | return -EFAULT; | 204 | return -EFAULT; |