Thread (83 messages) flat view 83 messages, 9 authors, 2017-11-14
STALE3198d

[PATCH v2 10/21] xfrm6_tunnel: exit_net cleanup check added

From: Vasily Averin <hidden>
Date: 2017-11-05 16:50:46
Subsystem: networking [general], networking [ipsec], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Steffen Klassert, Herbert Xu, Linus Torvalds

Be sure that spi_byaddr and spi_byspi arrays initialized in net_init hook
were return to initial state

Signed-off-by: Vasily Averin <redacted>
---
 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..8280152 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]),
+			 "%s: spi_byaddr is not empty\n", __func__))
+			break;
+
+	for (i = 0; i < XFRM6_TUNNEL_SPI_BYSPI_HSIZE; i++)
+		if (WARN(!hlist_empty(&xfrm6_tn->spi_byspi[i]),
+			 "%s: spi_byspi is not empty\n", __func__))
+			break;
 }
 
 static struct pernet_operations xfrm6_tunnel_net_ops = {
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help