Subject: Re: [PATCH] xfrm: Fix wraparound in xfrm_policy_addr_delta()

From: Florian Westphal <[email-masked]>
Date: Wed, 30 Dec 2020 13:46:19 +0100

Visa Hankala <[email-masked]> wrote:
> On Tue, Dec 29, 2020 at 05:01:27PM +0100, Florian Westphal wrote:
> > This is suspicious.  Is prefixlen == 0 impossible?
> > 
> > If not, then after patch
> > mask = ~0U << 32;
> > 
> > ... and function returns 0.
> 
> With prefixlen == 0, there is only one equivalence class, so
> returning 0 seems reasonable to me.

Right, that seems reasonable indeed.

> Is there a reason why the function has treated /0 prefix as /32
> with IPv4? IPv6 does not have this treatment.

Not that I recall, looks like a bug.