Re: [PATCH iproute2 v1] ip netns: allow negative nsid

2018-02-08 Thread Christian Brauner
On Thu, Feb 8, 2018 at 5:01 PM, Stephen Hemminger wrote: > On Tue, 6 Feb 2018 19:39:31 +0100 > Christian Brauner 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(). An

Re: [PATCH iproute2 v1] ip netns: allow negative nsid

2018-02-08 Thread Stephen Hemminger
On Tue, 6 Feb 2018 19:39:31 +0100 Christian Brauner 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 ra

[PATCH iproute2 v1] ip netns: allow negative nsid

2018-02-06 Thread Christian Brauner
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,