From: Flavio Leitner <fbl@sysclose•org>
To: Nicolas Dichtel <nicolas.dichtel@6wind•com>
Cc: netdev@vger•kernel.org
Subject: Re: [PATCH net-next] netlink: include netnsid only when netns differs.
Date: Wed, 31 May 2017 15:34:57 -0300 [thread overview]
Message-ID: <20170531183457.GM2673@x240.lan> (raw)
In-Reply-To: <c4250fae-3bf8-f646-9a68-de91419b0b8b@6wind.com>
On Wed, May 31, 2017 at 03:48:06PM +0200, Nicolas Dichtel wrote:
> Le 31/05/2017 à 14:28, Flavio Leitner a écrit :
> > On Wed, May 31, 2017 at 10:38:21AM +0200, Nicolas Dichtel wrote:
> >> Le 30/05/2017 à 23:33, Flavio Leitner a écrit :
> >>> Don't include netns id for notifications broadcasts when the
> >>> socket and the skb are in the same netns because it will be
> >>> an error which can't be distinguished from a peer netns failing
> >>> to allocate an id.
> >> I don't understand the problem. peernet2id() doesn't allocate ids, it only do a
> >> lookup. If you need an id for the current netns, you have to allocate one.
> >
> > The issue is that if you query an interface on the same netns, the
> > error is returned, then we cannot tell if the iface is on the same
> > netns or if there was an error while allocating the ID and the
> > iface is on another netns.
> If the returned id is NETNSA_NSID_NOT_ASSIGNED, then the netns is the same.
>
> Some lines before your patch, we call peernet_has_id() when the netns differ,
> thus we ensure that the id is available.
Right, but that's internal to the kernel.
> The principle was that netlink messages of other netns can be sent only if an id
> is assigned.
OK, could you please update include/uapi/linux/net_namespace.h to reflect that?
It says NETNSA_NSID_NOT_ASSIGNED are attributes for RTM_NEWNSID or RTM_GETNSID
which makes sense, but NOT_ASSIGNED sounds little like SAME_NSID for other
message types.
--
Flavio
next prev parent reply other threads:[~2017-05-31 18:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-30 21:33 [PATCH net-next] netlink: include netnsid only when netns differs Flavio Leitner
2017-05-31 8:38 ` Nicolas Dichtel
2017-05-31 12:28 ` Flavio Leitner
2017-05-31 13:48 ` Nicolas Dichtel
2017-05-31 18:34 ` Flavio Leitner [this message]
2017-06-01 7:57 ` Nicolas Dichtel
2017-06-01 8:00 ` [PATCH net] netlink: don't send unknown nsid Nicolas Dichtel
2017-06-01 15:50 ` David Miller
2017-06-01 17:02 ` Flavio Leitner
2017-06-01 20:42 ` Nicolas Dichtel
2017-06-01 22:44 ` Flavio Leitner
2017-06-05 8:40 ` Nicolas Dichtel
2017-06-07 18:40 ` Flavio Leitner
2017-06-08 8:31 ` Nicolas Dichtel
2017-06-09 17:33 ` Flavio Leitner
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=20170531183457.GM2673@x240.lan \
--to=fbl@sysclose$(echo .)org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=nicolas.dichtel@6wind$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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