diff options
author | Denis V. Lunev <den@openvz.org> | 2008-03-24 15:31:00 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-03-24 15:31:00 -0700 |
commit | cb84663e4d239f23f0d872bc6463c272e74daad8 (patch) | |
tree | f3153fbf15585870f98f261606df014b8780a548 /net/ipv4/ip_sockglue.c | |
parent | 7a6adb92fe301c10ca4dbd0d9f2422f5880595e7 (diff) | |
download | kernel_samsung_tuna-cb84663e4d239f23f0d872bc6463c272e74daad8.zip kernel_samsung_tuna-cb84663e4d239f23f0d872bc6463c272e74daad8.tar.gz kernel_samsung_tuna-cb84663e4d239f23f0d872bc6463c272e74daad8.tar.bz2 |
[NETNS]: Process IP layer in the context of the correct namespace.
Replace all the rest of the init_net with a proper net on the IP layer.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_sockglue.c')
-rw-r--r-- | net/ipv4/ip_sockglue.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 0857f2d..b854431 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c @@ -449,7 +449,8 @@ static int do_ip_setsockopt(struct sock *sk, int level, struct ip_options * opt = NULL; if (optlen > 40 || optlen < 0) goto e_inval; - err = ip_options_get_from_user(&init_net, &opt, optval, optlen); + err = ip_options_get_from_user(sk->sk_net, &opt, + optval, optlen); if (err) break; if (inet->is_icsk) { @@ -589,13 +590,13 @@ static int do_ip_setsockopt(struct sock *sk, int level, err = 0; break; } - dev = ip_dev_find(&init_net, mreq.imr_address.s_addr); + dev = ip_dev_find(sk->sk_net, mreq.imr_address.s_addr); if (dev) { mreq.imr_ifindex = dev->ifindex; dev_put(dev); } } else - dev = __dev_get_by_index(&init_net, mreq.imr_ifindex); + dev = __dev_get_by_index(sk->sk_net, mreq.imr_ifindex); err = -EADDRNOTAVAIL; |