diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-07-20 01:34:43 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-20 01:34:43 -0400 |
commit | 721499e8931c5732202481ae24f2dfbf9910f129 (patch) | |
tree | c94d8d681966109bb41f712f21f3a9825ae2172d /net/packet/af_packet.c | |
parent | 407d819cf0fd54c6fc1138a509225696aecafd15 (diff) |
netns: Use net_eq() to compare net-namespaces for optimization.
Without CONFIG_NET_NS, namespace is always &init_net.
Compiler will be able to omit namespace comparisons with this patch.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/packet/af_packet.c')
-rw-r--r-- | net/packet/af_packet.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index de73bcb5235a..d56cae112dc8 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -1677,7 +1677,7 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd, | |||
1677 | case SIOCGIFDSTADDR: | 1677 | case SIOCGIFDSTADDR: |
1678 | case SIOCSIFDSTADDR: | 1678 | case SIOCSIFDSTADDR: |
1679 | case SIOCSIFFLAGS: | 1679 | case SIOCSIFFLAGS: |
1680 | if (sock_net(sk) != &init_net) | 1680 | if (!net_eq(sock_net(sk), &init_net)) |
1681 | return -ENOIOCTLCMD; | 1681 | return -ENOIOCTLCMD; |
1682 | return inet_dgram_ops.ioctl(sock, cmd, arg); | 1682 | return inet_dgram_ops.ioctl(sock, cmd, arg); |
1683 | #endif | 1683 | #endif |