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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user