summaryrefslogtreecommitdiff
path: root/net/xfrm/xfrm_user.c
diff options
context:
space:
mode:
authorFan Du <fan.du@windriver.com>2013-11-07 13:47:49 +0400
committerSteffen Klassert <steffen.klassert@secunet.com>2013-12-06 09:45:05 +0400
commit8d549c4f5d92d80fc6f888fd314e10972ae0ec37 (patch)
treece8175ec97d47ff6cc6a46360bde3788fca49934 /net/xfrm/xfrm_user.c
parente682adf021be796940be6cc10c07be7f7398c220 (diff)
downloadlinux-8d549c4f5d92d80fc6f888fd314e10972ae0ec37.tar.xz
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/xfrm/xfrm_user.c')
-rw-r--r--net/xfrm/xfrm_user.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 4e0546e9bb0a..840cc8d9fbe4 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -2137,6 +2137,7 @@ static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh,
u8 type;
int err;
int n = 0;
+ struct net *net = sock_net(skb->sk);
if (attrs[XFRMA_MIGRATE] == NULL)
return -EINVAL;
@@ -2154,7 +2155,7 @@ static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh,
if (!n)
return 0;
- xfrm_migrate(&pi->sel, pi->dir, type, m, n, kmp);
+ xfrm_migrate(&pi->sel, pi->dir, type, m, n, kmp, net);
return 0;
}