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