From: Eric Dumazet <eric.dumazet@gmail.com>
To: Andrew Vagin <avagin@openvz.org>
Cc: "David S. Miller" <davem@davemloft.net>,
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
James Morris <jmorris@namei.org>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
Patrick McHardy <kaber@trash.net>,
Pavel Emelyanov <xemul@parallels.com>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] net-next: make sock diag per-namespace
Date: Mon, 16 Jul 2012 14:32:25 +0200 [thread overview]
Message-ID: <1342441945.23494.23.camel@edumazet-glaptop> (raw)
In-Reply-To: <1342440849-1757320-1-git-send-email-avagin@openvz.org>
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.
...
> 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
> @@ -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 ?
next prev parent reply other threads:[~2012-07-16 12:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-16 12:14 [PATCH] net-next: make sock diag per-namespace Andrew Vagin
2012-07-16 12:32 ` Eric Dumazet [this message]
2012-07-16 12:38 ` Andrew Vagin
2012-07-16 17:26 ` Jan Ceuleers
2012-07-16 14:00 ` Ben Hutchings
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1342441945.23494.23.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=avagin@openvz.org \
--cc=davem@davemloft.net \
--cc=jmorris@namei.org \
--cc=kaber@trash.net \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=xemul@parallels.com \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox