From: David Ahern <dsahern@gmail.com>
To: nicolas.dichtel@6wind.com, Joe Stringer <joe@wand.net.nz>
Cc: netdev <netdev@vger.kernel.org>, daniel@iogearbox.net
Subject: Re: netns_id in bpf_sk_lookup_{tcp,udp}
Date: Tue, 20 Nov 2018 08:46:59 -0700 [thread overview]
Message-ID: <954e5e2c-d72d-5a87-e050-3e550273cce0@gmail.com> (raw)
In-Reply-To: <1754196d-67a8-6632-878f-72e0e6c2d917@6wind.com>
On 11/20/18 2:05 AM, Nicolas Dichtel wrote:
> Le 20/11/2018 à 00:46, David Ahern a écrit :
> [snip]
>> That revelation shows another hole:
>> $ ip netns add foo
>> $ ip netns set foo 0xffffffff
> It also works with 0xf0000000 ...
yes, I realized last night I sent a bad example. I meant any negative
number besides -1
>
>> $ ip netns list
>> foo (id: 0)
>>
>> Seems like alloc_netid() should error out if reqid < -1 (-1 being the
>> NETNSA_NSID_NOT_ASSIGNED flag) as opposed to blindly ignoring it.
> alloc_netid() tries to allocate the specified nsid if this nsid is valid, ie >=
> 0, else it allocates a new nsid (actually the lower available).
> This is the expected behavior.
>
> For me, it's more an iproute2 problem, which parses an unsigned and silently
> cast it to a signed value.
so your intention is that any < 0 value means auto generate not just -1.
next prev parent reply other threads:[~2018-11-21 2:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-19 3:26 netns_id in bpf_sk_lookup_{tcp,udp} David Ahern
2018-11-19 18:36 ` Joe Stringer
2018-11-19 18:39 ` David Ahern
2018-11-19 19:47 ` Joe Stringer
2018-11-19 19:54 ` David Ahern
2018-11-19 20:28 ` Nicolas Dichtel
2018-11-19 20:54 ` Joe Stringer
2018-11-19 21:59 ` Joe Stringer
2018-11-19 23:46 ` David Ahern
2018-11-20 9:05 ` Nicolas Dichtel
2018-11-20 15:46 ` David Ahern [this message]
2018-11-20 16:03 ` Nicolas Dichtel
2018-11-21 5:12 ` David Ahern
2018-11-21 9:44 ` [PATCH iproute2] ipnetns: parse nsid as a signed integer Nicolas Dichtel
2018-11-21 17:37 ` Stephen Hemminger
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=954e5e2c-d72d-5a87-e050-3e550273cce0@gmail.com \
--to=dsahern@gmail.com \
--cc=daniel@iogearbox.net \
--cc=joe@wand.net.nz \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.