summaryrefslogtreecommitdiff
path: root/net/key/af_key.c
diff options
context:
space:
mode:
authorFan Du <fan.du@windriver.com>2013-11-07 17:47:49 +0800
committerSteffen Klassert <steffen.klassert@secunet.com>2013-12-06 06:45:05 +0100
commit8d549c4f5d92d80fc6f888fd314e10972ae0ec37 (patch)
treece8175ec97d47ff6cc6a46360bde3788fca49934 /net/key/af_key.c
parente682adf021be796940be6cc10c07be7f7398c220 (diff)
xfrm: Using the right namespace to migrate key info
because the home agent could surely be run on a different net namespace other than init_net. The original behavior could lead into inconsistent of key info. Signed-off-by: Fan Du <fan.du@windriver.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/key/af_key.c')
-rw-r--r--net/key/af_key.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 545f047868ad..3fa811c46913 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -2485,6 +2485,7 @@ static int pfkey_migrate(struct sock *sk, struct sk_buff *skb,
struct xfrm_selector sel;
struct xfrm_migrate m[XFRM_MAX_DEPTH];
struct xfrm_kmaddress k;
+ struct net *net = sock_net(sk);
if (!present_and_same_family(ext_hdrs[SADB_EXT_ADDRESS_SRC - 1],
ext_hdrs[SADB_EXT_ADDRESS_DST - 1]) ||
@@ -2558,7 +2559,7 @@ static int pfkey_migrate(struct sock *sk, struct sk_buff *skb,
}
return xfrm_migrate(&sel, dir, XFRM_POLICY_TYPE_MAIN, m, i,
- kma ? &k : NULL);
+ kma ? &k : NULL, net);
out:
return err;