Hi, On Wed, Mar 28, 2012 at 11:03:43AM +0200, Alon Bar-Lev wrote: > 0xffffffff as-is is valid ipv4 address/netmask... > > I found only this warning, if there are more places, I guess these > needs to be fixed as well. So if you agree to the above, I will find > the other places.
I'd opt for having a well-understandable define, like
#define IPV4_NETMASK_HOSTONLY 0xffffffffU
(note the "U", that will make sure all compilers know "hey, unsigned!")
and use that constant in places that use ~0 today in this very specific
meaning.
A quick grep turned up places in pf.c, route.c (where some places actually
seem to mean "-1", like in windows-route_find_if_index()?!?), tun.c
I'd rather not tackle "those other places" in this go, just the "this is
a host-only netmask!" bits.
gert
--
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]
fax: +49-89-35655025 [email protected]
pgpwAfxC8HiPx.pgp
Description: PGP signature
