net: make sock diag per-namespace
authorAndrey Vagin <avagin@openvz.org>
Mon, 16 Jul 2012 04:28:49 +0000 (04:28 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 17 Jul 2012 05:31:34 +0000 (22:31 -0700)
commit51d7cccf07238f5236c5b9269231a30dd5f8e714
tree1155d43b810d0f163276182be610d69c50e862d9
parentcbc89c8cf279b85edc95b4ae40a9e7e1edf2dfae
net: make sock diag per-namespace

Before this patch sock_diag works for init_net only and dumps
information about sockets from all namespaces.

This patch expands sock_diag for all name-spaces.
It creates a netlink kernel socket for each netns and filters
data during dumping.

v2: filter accoding with netns in all places
    remove an unused variable.

Cc: "David S. Miller" <davem@davemloft.net>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: James Morris <jmorris@namei.org>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Pavel Emelyanov <xemul@parallels.com>
CC: Eric Dumazet <eric.dumazet@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/sock_diag.h
include/net/net_namespace.h
net/core/sock_diag.c
net/ipv4/inet_diag.c
net/ipv4/udp_diag.c
net/unix/diag.c