diff options
author | Ilan Tayari <ilant@mellanox.com> | 2017-05-08 03:30:18 -0400 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2017-05-08 03:41:09 -0400 |
commit | 2c1497bbc8fdee897341ab48ee9c9209b421b8c0 (patch) | |
tree | a4cd705e30cf4e8757e0fa82007a2be50a3ea798 | |
parent | d90c902449a7561f1b1d58ba5a0d11728ce8b0b2 (diff) |
xfrm: Fix NETDEV_DOWN with IPSec offload
Upon NETDEV_DOWN event, all xfrm_state objects which are bound to
the device are flushed.
The condition for this is wrong, though, testing dev->hw_features
instead of dev->features. If a device has non-user-modifiable
NETIF_F_HW_ESP, then its xfrm_state objects are not flushed,
causing a crash later on after the device is deleted.
Check dev->features instead of dev->hw_features.
Fixes: d77e38e612a0 ("xfrm: Add an IPsec hardware offloading API")
Signed-off-by: Ilan Tayari <ilant@mellanox.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
-rw-r--r-- | net/xfrm/xfrm_device.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c index 8ec8a3fcf8d4..574e6f32f94f 100644 --- a/net/xfrm/xfrm_device.c +++ b/net/xfrm/xfrm_device.c | |||
@@ -170,7 +170,7 @@ static int xfrm_dev_feat_change(struct net_device *dev) | |||
170 | 170 | ||
171 | static int xfrm_dev_down(struct net_device *dev) | 171 | static int xfrm_dev_down(struct net_device *dev) |
172 | { | 172 | { |
173 | if (dev->hw_features & NETIF_F_HW_ESP) | 173 | if (dev->features & NETIF_F_HW_ESP) |
174 | xfrm_dev_state_flush(dev_net(dev), dev, true); | 174 | xfrm_dev_state_flush(dev_net(dev), dev, true); |
175 | 175 | ||
176 | xfrm_garbage_collect(dev_net(dev)); | 176 | xfrm_garbage_collect(dev_net(dev)); |