aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/core/ethtool.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 31b1eddc1b84..0f2f82185ec4 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -135,21 +135,23 @@ u32 ethtool_op_get_flags(struct net_device *dev)
135int ethtool_op_set_flags(struct net_device *dev, u32 data) 135int ethtool_op_set_flags(struct net_device *dev, u32 data)
136{ 136{
137 const struct ethtool_ops *ops = dev->ethtool_ops; 137 const struct ethtool_ops *ops = dev->ethtool_ops;
138 unsigned long features = dev->features;
138 139
139 if (data & ETH_FLAG_LRO) 140 if (data & ETH_FLAG_LRO)
140 dev->features |= NETIF_F_LRO; 141 features |= NETIF_F_LRO;
141 else 142 else
142 dev->features &= ~NETIF_F_LRO; 143 features &= ~NETIF_F_LRO;
143 144
144 if (data & ETH_FLAG_NTUPLE) { 145 if (data & ETH_FLAG_NTUPLE) {
145 if (!ops->set_rx_ntuple) 146 if (!ops->set_rx_ntuple)
146 return -EOPNOTSUPP; 147 return -EOPNOTSUPP;
147 dev->features |= NETIF_F_NTUPLE; 148 features |= NETIF_F_NTUPLE;
148 } else { 149 } else {
149 /* safe to clear regardless */ 150 /* safe to clear regardless */
150 dev->features &= ~NETIF_F_NTUPLE; 151 features &= ~NETIF_F_NTUPLE;
151 } 152 }
152 153
154 dev->features = features;
153 return 0; 155 return 0;
154} 156}
155 157