Thread (5 messages) flat view 5 messages, 5 authors, 2012-07-16

Re: [PATCH] net-next: make sock diag per-namespace

From: Eric Dumazet <hidden>
Date: 2012-07-16 12:32:33
Also in: lkml

On Mon, 2012-07-16 at 16:14 +0400, Andrew Vagin wrote:
Before this patch sock_diag works for init_net only and dumps
information about sockets from all namespaces.
...
quoted hunk ↗ jump to hunk
diff --git a/net/ipv4/udp_diag.c b/net/ipv4/udp_diag.c
index a7f86a3..52f42f9 100644
--- a/net/ipv4/udp_diag.c
+++ b/net/ipv4/udp_diag.c
@@ -34,6 +34,7 @@ static int udp_dump_one(struct udp_table *tbl, struct sk_buff *in_skb,
 	int err = -EINVAL;
 	struct sock *sk;
 	struct sk_buff *rep;
+	struct net *net = sock_net(in_skb->sk);
 
 	if (req->sdiag_family == AF_INET)
 		sk = __udp4_lib_lookup(&init_net,
It seems you didnt fix udp_dump_one() correctly, since it
still mentions &init_net
quoted hunk ↗ jump to hunk
@@ -75,7 +76,7 @@ static int udp_dump_one(struct udp_table *tbl, struct sk_buff *in_skb,
 		kfree_skb(rep);
 		goto out;
 	}
-	err = netlink_unicast(sock_diag_nlsk, rep, NETLINK_CB(in_skb).pid,
+	err = netlink_unicast(net->diag_nlsk, rep, NETLINK_CB(in_skb).pid,
 			      MSG_DONTWAIT);
 	if (err > 0)
 		err = 0;
udp_dump() also needs some care ?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help