[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AE90C24D6B3A694183C094C60CF0A2F6D8AED9@saturn3.aculab.com>
Date: Tue, 22 Nov 2011 15:15:25 -0000
From: "David Laight" <David.Laight@...LAB.COM>
To: "Eric Dumazet" <eric.dumazet@...il.com>,
"Alexey Dobriyan" <adobriyan@...il.com>
Cc: <davem@...emloft.net>, <netdev@...r.kernel.org>
Subject: RE: [PATCH] xfrm: optimize ipv4 selector matching
> Please use :
>
> +static inline bool addr4_match(__be32 a1, __be32 a2, u8 prefixlen)
> +{
> + /* C99 6.5.7 (3): u32 << 32 is undefined behaviour */
> + if (prefixlen == 0)
> + return true;
> + return !((a1 ^ a2) & htonl(0xFFFFFFFFu << (32 - prefixlen)));
> +}
I'm not sure I'd agree about using 'u8'.
It may well cause an unnecessary mask with 0xff.
David
--
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