From: Christian Brauner <christian.brauner@canonical.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Christian Brauner <christian.brauner@ubuntu.com>,
Netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH iproute2 v1] ip netns: allow negative nsid
Date: Thu, 8 Feb 2018 23:50:30 +0100 [thread overview]
Message-ID: <CAPP7u0WjMDMyLk5bdH1vFXSo-uT69A4Kvhn+47ejQU_YcX0xvA@mail.gmail.com> (raw)
In-Reply-To: <20180208080124.796126b8@xeon-e3>
On Thu, Feb 8, 2018 at 5:01 PM, Stephen Hemminger
<stephen@networkplumber.org> wrote:
> On Tue, 6 Feb 2018 19:39:31 +0100
> Christian Brauner <christian.brauner@ubuntu.com> wrote:
>
>> If the kernel receives a negative nsid it will automatically assign the
>> next available nsid. In this case alloc_netid() will set min and max to
>> 0 for ird_alloc(). And when max == 0 idr_alloc() will interpret this as
>> the maxium range, i.e. specific to nsids it will try to find an id in
>> the range [0,INT_MAX). This is intentionally supported in the kernel for
>> nsids. Commit acbe9118ce8086f765ffb0da15f80c7c01a8903a regressed ip
>> netns in that respect although previously the use-case was either
>> accidentally supported or opaquely supported such that it triggered the
>> original commit. From what I can gather it went as follows before:
>> atoi() was called with a string indicating a negative value which caused
>> it to return -1 which was passed to the kernel. Let's make it less
>> opaque by introducing the keyword "auto":
>>
>> ip netns set <netns-name> auto
>>
>> will cause nsid to be set to -1 and the kernel will select an available
>> nsid.
>>
>> Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
>
> Applied thank you.
> I did have to fix spelling and format of commit reference in
> the commit description. If you run checkpatch on patches to
> iproute you would have caught that.
Ah, sorry about that. Didn't think about applying checkpatch to iproute
patches as well. Won't happen again!
Thanks for applying.
Christian
prev parent reply other threads:[~2018-02-08 22:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-06 18:39 [PATCH iproute2 v1] ip netns: allow negative nsid Christian Brauner
2018-02-08 16:01 ` Stephen Hemminger
2018-02-08 22:50 ` Christian Brauner [this message]
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=CAPP7u0WjMDMyLk5bdH1vFXSo-uT69A4Kvhn+47ejQU_YcX0xvA@mail.gmail.com \
--to=christian.brauner@canonical.com \
--cc=christian.brauner@ubuntu.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.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;
as well as URLs for NNTP newsgroup(s).