diff options
author | Vasily Averin <vvs@virtuozzo.com> | 2017-11-12 20:34:03 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-11-14 07:46:17 +0100 |
commit | baeb0dbbb56598a2ccd98b56e0da3e9d22869112 (patch) | |
tree | 3deede90cb8d2e33014fde5a4e99977b4e72cba6 /net/ipv6 | |
parent | ppp: exit_net cleanup checks added (diff) | |
download | linux-baeb0dbbb56598a2ccd98b56e0da3e9d22869112.tar.xz linux-baeb0dbbb56598a2ccd98b56e0da3e9d22869112.zip |
xfrm6_tunnel: exit_net cleanup check added
Be sure that spi_byaddr and spi_byspi arrays initialized in net_init hook
were return to initial state
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/xfrm6_tunnel.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c index 4e438bc7ee87..f85f0d7480ac 100644 --- a/net/ipv6/xfrm6_tunnel.c +++ b/net/ipv6/xfrm6_tunnel.c @@ -338,6 +338,14 @@ static int __net_init xfrm6_tunnel_net_init(struct net *net) static void __net_exit xfrm6_tunnel_net_exit(struct net *net) { + struct xfrm6_tunnel_net *xfrm6_tn = xfrm6_tunnel_pernet(net); + unsigned int i; + + for (i = 0; i < XFRM6_TUNNEL_SPI_BYADDR_HSIZE; i++) + WARN_ON_ONCE(!hlist_empty(&xfrm6_tn->spi_byaddr[i])); + + for (i = 0; i < XFRM6_TUNNEL_SPI_BYSPI_HSIZE; i++) + WARN_ON_ONCE(!hlist_empty(&xfrm6_tn->spi_byspi[i])); } static struct pernet_operations xfrm6_tunnel_net_ops = { |