Skip to content

Commit baeb0db

Browse files
vaverindavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e667500 commit baeb0db

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

net/ipv6/xfrm6_tunnel.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,14 @@ static int __net_init xfrm6_tunnel_net_init(struct net *net)
338338

339339
static void __net_exit xfrm6_tunnel_net_exit(struct net *net)
340340
{
341+
struct xfrm6_tunnel_net *xfrm6_tn = xfrm6_tunnel_pernet(net);
342+
unsigned int i;
343+
344+
for (i = 0; i < XFRM6_TUNNEL_SPI_BYADDR_HSIZE; i++)
345+
WARN_ON_ONCE(!hlist_empty(&xfrm6_tn->spi_byaddr[i]));
346+
347+
for (i = 0; i < XFRM6_TUNNEL_SPI_BYSPI_HSIZE; i++)
348+
WARN_ON_ONCE(!hlist_empty(&xfrm6_tn->spi_byspi[i]));
341349
}
342350

343351
static struct pernet_operations xfrm6_tunnel_net_ops = {

0 commit comments

Comments
 (0)