Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1486FC17440 for ; Sat, 9 Nov 2019 01:36:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D73BE214DA for ; Sat, 9 Nov 2019 01:36:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="C6zXJgV9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726402AbfKIBge (ORCPT ); Fri, 8 Nov 2019 20:36:34 -0500 Received: from mail-il1-f193.google.com ([209.85.166.193]:40159 "EHLO mail-il1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725817AbfKIBge (ORCPT ); Fri, 8 Nov 2019 20:36:34 -0500 Received: by mail-il1-f193.google.com with SMTP id d83so6788420ilk.7 for ; Fri, 08 Nov 2019 17:36:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=bXY9nJGvpXa2Hj2sERPdL08J0xpm8vhzQIH+YlWH51E=; b=C6zXJgV9/u+Wn6pMS8SSQFn0srTX6nLN2C/CLM1m44TtrvLYjgK/NEVsl4tsyqLrDy OWIBzthUChXNEPPPvrFVYKnB8L9ASGfJuqzTM+bjGmtZPml/Sx3my1Gs5mPUp5iXXZaZ olK89C0Iibnkjhd0zdvmmB1zsB+yKF+mG8WZD9oP8wVFIEEym7PI7hBAutDv4YGHhykN BjngdCBWq06MszUt+YGyS6DHCcM4GfJg5ZAGrCU14W1sm9hl6NCpjuw4+t+AcxPWvNEa xTMpo/FxWGe1ADNXW1a99LvWvz5QLv+T15d/83TnikDNA2vUjwwKeawoGdY8l6yE1uSZ v8vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=bXY9nJGvpXa2Hj2sERPdL08J0xpm8vhzQIH+YlWH51E=; b=DAysgf7hlNWqvnMJ7tzw07nAW+OP2EGlENiQb9l11vltSsEZQbDbP9CUkCoeh9TziD 4joarwwX6rcWRUWj7320HdSExnJvR6QM6Rh2e8qU0anCxafszijwPvSQ+whJxkDwS2zx XO8OEp7yd6JNZfb63F7PAgHpq2kLvASCiP0IGRgiv923K+CIhUXvNCRWZG7IYA+JW6oe U6TYWCb2VSc8olq4a//xzrv0Ke96F2etb7mzmLJRk8avvXcyZGHxOjNC9on7Wquv1hx5 jNeQR2IyXTPk/zIfiCeY4eKywyAvjLtAfffwuMTL+cILql5l1tzf0Z+8/baOTtmXXhQS XkUg== X-Gm-Message-State: APjAAAXnF3hCpmUWRXV/GvjEiNjaoHa5isTlxb5LAv7cZNY3Pg0sjRJs lFh9aKa4LK0Yabpgem/jH7+tF6GbsRQ= X-Google-Smtp-Source: APXvYqzJN+lEPUlhkF1NuLCfA43Z2R3eq4IQEK8MiKpmRcKKLDwuqOtjex74oicFonSlpS7WzvCieA== X-Received: by 2002:a92:9ace:: with SMTP id c75mr16904958ill.296.1573263393893; Fri, 08 Nov 2019 17:36:33 -0800 (PST) Received: from dahern-DO-MB.local ([2601:282:800:fd80:9c6a:665b:15c2:c3c0]) by smtp.googlemail.com with ESMTPSA id g23sm602986ioe.73.2019.11.08.17.36.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Nov 2019 17:36:32 -0800 (PST) Subject: Re: [PATCH iproute2-next 0/5] ipnetns: cleanup and harden processing of netns ids To: Guillaume Nault Cc: netdev@vger.kernel.org, Nicolas Dichtel References: From: David Ahern Message-ID: Date: Fri, 8 Nov 2019 18:36:31 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 11/8/19 10:00 AM, Guillaume Nault wrote: > It's currently hard to review ipnetns. The netns ids are inconsistently > treated as signed or unsigned and most helper functions aren't prepared > to use negative ids. > > Netns id attributes can be negative: NETNSA_NSID_NOT_ASSIGNED == -1. > So let's consistently treat nsids as signed and also reject negative > values in functions that are supposed to only handle assigned netns > ids. > > While there, let's drop the extra blank line generated by some command > line parsing errors (patch 5/5). > > Guillaume Nault (5): > ipnetns: treat NETNSA_NSID and NETNSA_CURRENT_NSID as signed > ipnetns: fix misleading comment about 'ip monitor nsid' > ipnetns: harden helper functions wrt. negative netns ids > ipnetns: don't print unassigned nsid in json export > ipnetns: remove blank lines printed by invarg() messages > > ip/ipnetns.c | 49 +++++++++++++++++++++++++++++-------------------- > 1 file changed, 29 insertions(+), 20 deletions(-) > looks good. applied to iproute2-next. Thanks for doing the cleanup.