[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20181115111345.GS6440@orbyte.nwl.cc>
Date: Thu, 15 Nov 2018 12:13:45 +0100
From: Phil Sutter <phil@....cc>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: netdev@...r.kernel.org
Subject: Re: [iproute PATCH] ip-address: Fix filtering by negated address
flags
Hi Stephen,
On Wed, Nov 14, 2018 at 11:29:03AM -0800, Stephen Hemminger wrote:
[...]
> I was thinking something like this which simplifies the logic.
>
> diff --git a/ip/ipaddress.c b/ip/ipaddress.c
> index cd8cc76a3473..3f1510383071 100644
> --- a/ip/ipaddress.c
> +++ b/ip/ipaddress.c
> @@ -1212,37 +1212,34 @@ static void print_ifa_flags(FILE *fp, const struct ifaddrmsg *ifa,
> static int get_filter(const char *arg)
> {
> unsigned int i;
> + bool inv = false;
>
> /* Special cases */
> if (strcmp(arg, "dynamic") == 0) {
> - filter.flags &= ~IFA_F_PERMANENT;
> - filter.flagmask |= IFA_F_PERMANENT;
> + arg = "-permanent";
I like this idea, also because it's much easier to get how 'dynamic' and
'primary' are special. I'll respin then.
Thanks, Phil
Powered by blists - more mailing lists