net: Make AF_PACKET handle multiple network namespaces
Subsystems (3)
PATCH 4/6 net: Make AF_PACKET handle multiple network namespaces
This is done by making packet_sklist_lock and packet_sklist per network namespace and adding an additional filter condition on received packets to ensure they came from the proper network namespace.
Changes from v1:
- prohibit to call inet_dgram_ops.ioctl in other than init_net
Signed-off-by Denis V. Lunev <[email protected]>
Signed-off-by Eric W. Biederman <[email protected]>
--- include/net/net_namespace.h | 4 + net/packet/af_packet.c | 131 ++++++++++++++++++++++++++++--------------- 2 files changed, 89 insertions(+), 46 deletions(-)
include/net/net_namespace.h +4 -0
@@ -32,6 +32,10 @@ struct net {struct hlist_head *dev_index_head;struct sock *rtnl;/* rtnetlink socket */ + +/* List of all packet sockets. */ +rwlock_t packet_sklist_lock; +struct hlist_head packet_sklist; };#ifdef CONFIG_NET
net/packet/af_packet.c +85 -46
324 lines not on this page · raw message
Signature · 1 line
1.5.3.rc5
From: "Denis V. Lunev" <[email protected]>
Date: Thu, 15 Nov 2007 18:59:54 +0300
Quoted 10 lines
This is done by making
packet_sklist_lockandpacket_sklistper network namespace and adding an additional filter condition on received packets to ensure they came from the proper network namespace.Changes from v1:
- prohibit to call inet_dgram_ops.ioctl in other thaninit_netSigned-off-by Denis V. Lunev <[email protected]>Signed-off-by Eric W. Biederman <[email protected]>
Applied.