[PATCH 07/11] Route: avoided undefined behaviour.

Andrew Clayton andrew at digital-domain.net
Thu Jun 16 17:55:54 UTC 2022


On Thu, 16 Jun 2022 17:55:58 +0200
Alejandro Colomar <alx.manpages at gmail.com> wrote:

> > -        inet->end = htonl(0xFFFFFFFF & (0xFFFFFFFF << (32 - cidr_prefix)));
> > +        inet->end = htonl(0xFFFFFFFF & (0xFFFFFFFFUL << (32 - cidr_prefix)));  
> 
> Do we support platforms with 32-bit long?  I'm not sure.  To be safe, 

Actually, 32 bit Linux would count and I guess the same for FreeBSD et
al..

> I'd use ULL.  Makes sense?

Indeed.

Cheers,
Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.nginx.org/pipermail/unit/attachments/20220616/10fbb10e/attachment.bin>


More information about the unit mailing list