Skip to content

Commit

Permalink
packet : remove init_net restriction
Browse files Browse the repository at this point in the history
The af_packet protocol is used by Perl to do ioctls as reported by
Stephane Riviere:

"Net::RawIP relies on SIOCGIFADDR et SIOCGIFHWADDR to get the IP and MAC
addresses of the network interface."

But in a new network namespace these ioctl fail because it is disabled for
a namespace different from the init_net_ns.

These two lines should not be there as af_inet and af_packet are
namespace aware since a long time now. I suppose we forget to remove these
lines because we sent the af_packet first, before af_inet was supported.

Signed-off-by: Daniel Lezcano <[email protected]>
Reported-by: Stephane Riviere <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
dlezcano authored and davem330 committed Apr 16, 2010
1 parent 31f634a commit 1c4f019
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions net/packet/af_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -2169,8 +2169,6 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd,
case SIOCGIFDSTADDR:
case SIOCSIFDSTADDR:
case SIOCSIFFLAGS:
if (!net_eq(sock_net(sk), &init_net))
return -ENOIOCTLCMD;
return inet_dgram_ops.ioctl(sock, cmd, arg);
#endif

Expand Down

0 comments on commit 1c4f019

Please sign in to comment.