Skip to content

Commit

Permalink
xfrm6_tunnel: exit_net cleanup check added
Browse files Browse the repository at this point in the history
Be sure that spi_byaddr and spi_byspi arrays initialized in net_init hook
were return to initial state

Signed-off-by: Vasily Averin <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
vaverin authored and davem330 committed Nov 14, 2017
1 parent e667500 commit baeb0db
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions net/ipv6/xfrm6_tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit baeb0db

Please sign in to comment.