[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAedzxo2JC6yk5Oz2_ya_FrPuDzb+RdS4wi_ri-F2oUK9H9DWw@mail.gmail.com>
Date: Wed, 28 Jan 2015 21:03:14 +0900
From: Erik Kline <ek@...gle.com>
To: Hannes Frederic Sowa <hannes@...essinduktion.org>
Cc: netdev <netdev@...r.kernel.org>, David Miller <davem@...emloft.net>
Subject: Re: [PATCH net] net: ipv6: allow explicitly choosing optimistic addresses
On Sun, Jan 25, 2015 at 9:46 PM, Hannes Frederic Sowa
<hannes@...essinduktion.org> wrote:
> Hi,
>
> On Wed, Jan 21, 2015, at 08:02, Erik Kline wrote:
>> if (ipv6_addr_equal(&ifp->addr, addr) &&
>> - !(ifp->flags&IFA_F_TENTATIVE) &&
>> + (!(ifp->flags&IFA_F_TENTATIVE) ||
>> + ifp->flags&IFA_F_OPTIMISTIC) &&
>> + !(ifp->flags&banned_flags) &&
>> (dev == NULL || ifp->idev->dev == dev ||
>
> Can the wrapper take the IFA_F_TENTATIVE and IFA_F_OPTIMISTIC into the
> banned_flags argument, so this condition becomes easier to read? The new
> caller could also specify them verbatim. I think it would improve
> readability.
So I did a bit of fiddling (and some fiddling of bits) and I've got a
working version with your suggestion.
Note that because we use 2 flags to represent optimistic state we
still have a bit of complication in order to check whether or not
optimistic is explicitly banned or not (as opposed to accidentally
banned by virtue of its pairing with tentative).
Thanks,
-Erik
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists