From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Brauner Subject: Re: [PATCH iproute2 v1] ip netns: allow negative nsid Date: Thu, 8 Feb 2018 23:50:30 +0100 Message-ID: References: <20180206183931.4893-1-christian.brauner@ubuntu.com> <20180208080124.796126b8@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Christian Brauner , Netdev To: Stephen Hemminger Return-path: Received: from youngberry.canonical.com ([91.189.89.112]:51251 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750961AbeBHWuc (ORCPT ); Thu, 8 Feb 2018 17:50:32 -0500 Received: from mail-wr0-f198.google.com ([209.85.128.198]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1ejv1T-00018r-OI for netdev@vger.kernel.org; Thu, 08 Feb 2018 22:50:31 +0000 Received: by mail-wr0-f198.google.com with SMTP id 30so3421151wrw.6 for ; Thu, 08 Feb 2018 14:50:31 -0800 (PST) In-Reply-To: <20180208080124.796126b8@xeon-e3> Sender: netdev-owner@vger.kernel.org List-ID: 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(). 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 auto >> >> will cause nsid to be set to -1 and the kernel will select an available >> nsid. >> >> Signed-off-by: Christian Brauner > > 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