diff options
author | 2018-12-19 06:08:48 +0000 | |
---|---|---|
committer | 2018-12-19 12:28:07 -0800 | |
commit | 965fa8e600d28d98e7e0c7340517a9c139843ee3 (patch) | |
tree | 93761e57cf0247eac0a78a93f945e0f02958543e /net/xfrm/xfrm_input.c | |
parent | mlxsw: spectrum_router: Propagate 'struct mlxsw_sp' further (diff) | |
download | wireguard-linux-965fa8e600d28d98e7e0c7340517a9c139843ee3.tar.xz wireguard-linux-965fa8e600d28d98e7e0c7340517a9c139843ee3.zip |
mlxsw: spectrum_router: Make RIF deletion more robust
In the past we had multiple instances where RIFs were not properly
deleted.
One of the reasons for leaking a RIF was that at the time when IP
addresses were flushed from the respective netdev (prompting the
destruction of the RIF), the netdev was no longer a mlxsw upper. This
caused the inet{,6}addr notification blocks to ignore the NETDEV_DOWN
event and leak the RIF.
Instead of checking whether the netdev is our upper when an IP address
is removed, we can instead check if the netdev has a RIF configured.
To look up a RIF we need to access mlxsw private data, so the patch
stores the notification blocks inside a mlxsw struct. This then allows
us to use container_of() and extract the required private data.
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm/xfrm_input.c')
0 files changed, 0 insertions, 0 deletions