Message-ID: <4F72CE7E.90704@...1114...> Date: Wed, 28 Mar 2012 10:40:30 +0200 From: David Sommerseth MIME-Version: 1.0 References: <1332797200-9295-7-git-send-email-alon.barlev@...277...> In-Reply-To: <1332797200-9295-7-git-send-email-alon.barlev@...277...> Subject: Re: [Openvpn-devel] [PATCH 6/6] cleanup: ~0 is too large for 32bit ipv4 address List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit To: Alon Bar-Lev Cc: openvpn-devel@lists.sourceforge.net -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 26/03/12 23:26, Alon Bar-Lev wrote: > Signed-off-by: Alon Bar-Lev --- > src/openvpn/route.c | 2 +- 1 files changed, 1 insertions(+), 1 > deletions(-) > > diff --git a/src/openvpn/route.c b/src/openvpn/route.c index > bf7af63..608403b 100644 --- a/src/openvpn/route.c +++ > b/src/openvpn/route.c @@ -268,7 +268,7 @@ init_route (struct route > *r, const struct route_option *ro, const struct route_list *rl) { - > const in_addr_t default_netmask = ~0; + const in_addr_t > default_netmask = 0xffffffff; Please can you explain more in detail why this change is needed? In my perspective, using ~0 is safer as it will always set all bits - no matter the size of default_netmask. And there are many more places in in source code where ~0 is used to provide that netmask. I would like to see some consistency, rather to just fix warnings which appears on some platform(s). In general, if you can provide a more verbose description why the patch is written in the commit messages, it will also help the review process. Most of us are not that skilled in reading others mind ;-) kind regards, David Sommerseth -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk9yznwACgkQDC186MBRfrrt9ACfbubdsMWzvKQnav6pQxyOXYwM 8XoAn1jCoLOQO6PS4TfBE+1YiNGeCm+U =ABwa -----END PGP SIGNATURE-----