[<prev] [next>] [day] [month] [year] [list]
Message-ID: <e5a1add3-f484-3bd0-1bac-7718c86ddc24@virtuozzo.com>
Date: Sun, 5 Nov 2017 13:00:53 +0300
From: Vasily Averin <vvs@...tuozzo.com>
To: netdev@...r.kernel.org
Cc: Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
Herbert Xu <herbert@...dor.apana.org.au>,
Steffen Klassert <steffen.klassert@...unet.com>
Subject: [PATCH 10/21] 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@...tuozzo.com>
---
net/ipv6/xfrm6_tunnel.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c
index 4e438bc..3825e03 100644
--- a/net/ipv6/xfrm6_tunnel.c
+++ b/net/ipv6/xfrm6_tunnel.c
@@ -338,6 +338,18 @@ 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++)
+ if (WARN(!hlist_empty(&xfrm6_tn->spi_byaddr[i]),
+ "net %p exit: xfrm6 spi_byaddr is not empty\n", net))
+ break;
+
+ for (i = 0; i < XFRM6_TUNNEL_SPI_BYSPI_HSIZE; i++)
+ if (WARN(!hlist_empty(&xfrm6_tn->spi_byspi[i]),
+ "net %p exit: xfrm6 spi_byspi is not empty\n", net))
+ break;
}
static struct pernet_operations xfrm6_tunnel_net_ops = {
--
2.7.4
Powered by blists - more mailing lists