From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [iproute PATCH] ip-address: Fix filtering by negated address flags Date: Tue, 13 Nov 2018 14:47:59 -0800 Message-ID: <20181113144759.26a4d403@shemminger-XPS-13-9360> References: <20181113151201.19297-1-phil@nwl.cc> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: Phil Sutter Return-path: Received: from mail-pl1-f169.google.com ([209.85.214.169]:41703 "EHLO mail-pl1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726022AbeKNIsW (ORCPT ); Wed, 14 Nov 2018 03:48:22 -0500 Received: by mail-pl1-f169.google.com with SMTP id p16-v6so6731876plr.8 for ; Tue, 13 Nov 2018 14:48:02 -0800 (PST) In-Reply-To: <20181113151201.19297-1-phil@nwl.cc> Sender: netdev-owner@vger.kernel.org List-ID: On Tue, 13 Nov 2018 16:12:01 +0100 Phil Sutter wrote: > + if (arg[0] == '-') { > + inv = true; > + arg++; > + } The inverse logic needs to be moved into the loop handling filter names. Otherwise, you get weirdness like "-dynamic" being accepted and not doing what was expected. Also, please make sure the man page matches the code.