diff options
author | Denis V. Lunev <den@openvz.org> | 2008-02-28 23:51:43 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-02-28 23:51:43 -0500 |
commit | e5b13cb10de209f924fdf9478214bcf7e4008d6d (patch) | |
tree | 212d723fe14e2dd49ab044f8ca969303f316645c /net/ipv4/af_inet.c | |
parent | 73b3871165e45ea6d57775c6bfb1a1760ad6e36b (diff) |
[NETNS]: Process devinet ioctl in the correct namespace.
Add namespace parameter to devinet_ioctl and locate device inside it for
state changes.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/af_inet.c')
-rw-r--r-- | net/ipv4/af_inet.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 09ca5293d08f..c270080f370e 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -784,6 +784,7 @@ int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | |||
784 | { | 784 | { |
785 | struct sock *sk = sock->sk; | 785 | struct sock *sk = sock->sk; |
786 | int err = 0; | 786 | int err = 0; |
787 | struct net *net = sk->sk_net; | ||
787 | 788 | ||
788 | switch (cmd) { | 789 | switch (cmd) { |
789 | case SIOCGSTAMP: | 790 | case SIOCGSTAMP: |
@@ -795,12 +796,12 @@ int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | |||
795 | case SIOCADDRT: | 796 | case SIOCADDRT: |
796 | case SIOCDELRT: | 797 | case SIOCDELRT: |
797 | case SIOCRTMSG: | 798 | case SIOCRTMSG: |
798 | err = ip_rt_ioctl(sk->sk_net, cmd, (void __user *)arg); | 799 | err = ip_rt_ioctl(net, cmd, (void __user *)arg); |
799 | break; | 800 | break; |
800 | case SIOCDARP: | 801 | case SIOCDARP: |
801 | case SIOCGARP: | 802 | case SIOCGARP: |
802 | case SIOCSARP: | 803 | case SIOCSARP: |
803 | err = arp_ioctl(sk->sk_net, cmd, (void __user *)arg); | 804 | err = arp_ioctl(net, cmd, (void __user *)arg); |
804 | break; | 805 | break; |
805 | case SIOCGIFADDR: | 806 | case SIOCGIFADDR: |
806 | case SIOCSIFADDR: | 807 | case SIOCSIFADDR: |
@@ -813,7 +814,7 @@ int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | |||
813 | case SIOCSIFPFLAGS: | 814 | case SIOCSIFPFLAGS: |
814 | case SIOCGIFPFLAGS: | 815 | case SIOCGIFPFLAGS: |
815 | case SIOCSIFFLAGS: | 816 | case SIOCSIFFLAGS: |
816 | err = devinet_ioctl(cmd, (void __user *)arg); | 817 | err = devinet_ioctl(net, cmd, (void __user *)arg); |
817 | break; | 818 | break; |
818 | default: | 819 | default: |
819 | if (sk->sk_prot->ioctl) | 820 | if (sk->sk_prot->ioctl) |