summaryrefslogtreecommitdiffstats
path: root/include/net/net_namespace.h
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2007-11-19 22:28:35 -0800
committerDavid S. Miller <davem@davemloft.net>2008-01-28 14:54:26 -0800
commitd12d01d6b4d197115c4d7736172b5b1ec8b1eb71 (patch)
tree480fc48e6ae404b59d2f62a7e3afc6ea88a5413c /include/net/net_namespace.h
parent4b3da706bbe4613d2fe4df8df4d965954ea98964 (diff)
downloadlinux-d12d01d6b4d197115c4d7736172b5b1ec8b1eb71.tar.gz
linux-d12d01d6b4d197115c4d7736172b5b1ec8b1eb71.tar.bz2
linux-d12d01d6b4d197115c4d7736172b5b1ec8b1eb71.zip
[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 <den@openvz.org> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/net_namespace.h')
-rw-r--r--include/net/net_namespace.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 90802a668c23..4d0d6349aa7e 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -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