Skip to contentSkip to conversation

netns xfrm: xfrm6_tunnel in netns

PATCH Applied Alexey Dobriyan 2 participants 2 messages Jan 25, 2010 – Jan 28, 2010

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 2/4 netns xfrm: xfrm6_tunnel in netns

I'm not sure about rcu stuff near kmem cache destruction:
* checks for non-empty hashes look bogus, they're done _before_ rcu_berrier()
* unregistering netns ops is done before kmem_cache destoy (as it should), and unregistering involves rcu barriers by itself

So it looks nothing should be done.

---

 include/net/xfrm.h      |    6 +-
 net/ipv6/ipcomp6.c      |    4 -
 net/ipv6/xfrm6_tunnel.c |  140 ++++++++++++++++++++++++++++--------------------
 3 files changed, 88 insertions(+), 62 deletions(-)
include/net/xfrm.h +3 -3
@@ -1408,9 +1408,9 @@ extern int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr,
 			    xfrm_address_t *saddr, u8 proto);
 extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler, unsigned short family);
 extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler, unsigned short family);
-extern __be32 xfrm6_tunnel_alloc_spi(xfrm_address_t *saddr);
-extern void xfrm6_tunnel_free_spi(xfrm_address_t *saddr);
-extern __be32 xfrm6_tunnel_spi_lookup(xfrm_address_t *saddr);
+extern __be32 xfrm6_tunnel_alloc_spi(struct net *net, xfrm_address_t *saddr);
+extern void xfrm6_tunnel_free_spi(struct net *net, xfrm_address_t *saddr);
+extern __be32 xfrm6_tunnel_spi_lookup(struct net *net, xfrm_address_t *saddr);
 extern int xfrm6_extract_output(struct xfrm_state *x, struct sk_buff *skb);
 extern int xfrm6_prepare_output(struct xfrm_state *x, struct sk_buff *skb);
 extern int xfrm6_output(struct sk_buff *skb);
net/ipv6/ipcomp6.c +2 -2
@@ -81,7 +81,7 @@ static struct xfrm_state *ipcomp6_tunnel_create(struct xfrm_state *x)
 		goto out;
 
 	t->id.proto = IPPROTO_IPV6;
-	t->id.spi = xfrm6_tunnel_alloc_spi((xfrm_address_t *)&x->props.saddr);
+	t->id.spi = xfrm6_tunnel_alloc_spi(&init_net, (xfrm_address_t *)&x->props.saddr);
 	if (!t->id.spi)
 		goto error;
 
@@ -112,7 +112,7 @@ static int ipcomp6_tunnel_attach(struct xfrm_state *x)
 	struct xfrm_state *t = NULL;
 	__be32 spi;
 
-	spi = xfrm6_tunnel_spi_lookup((xfrm_address_t *)&x->props.saddr);
+	spi = xfrm6_tunnel_spi_lookup(&init_net, (xfrm_address_t *)&x->props.saddr);
 	if (spi)
 		t = xfrm_state_lookup(&init_net, (xfrm_address_t *)&x->id.daddr,
 					      spi, IPPROTO_IPV6, AF_INET6);
net/ipv6/xfrm6_tunnel.c +83 -57

294 lines not on this page · raw message

maintainer Applied
#1 lore raw

From: Alexey Dobriyan <[email protected]>
Date: Mon, 25 Jan 2010 22:37:54 +0200

Quoted 9 lines

I'm not sure about rcu stuff near kmem cache destruction:
* checks for non-empty hashes look bogus, they're done _before_ rcu_berrier()
* unregistering netns ops is done before kmem_cache destoy (as it should), and unregistering involves rcu barriers by itself

So it looks nothing should be done.

Applied.