diff options
author | Ulrich Weber <uweber.linux@gmail.com> | 2015-01-05 15:58:34 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-01-08 15:30:37 +0100 |
commit | c03e20d7f594058ff223f30cf34de1b5e8210b8d (patch) | |
tree | f0d59bba740dd6b270f643888221961c5b40c7c2 | |
parent | b59934331c4b9271ceb5e30b793a552618299d39 (diff) | |
download | firewall3-c03e20d7f594058ff223f30cf34de1b5e8210b8d.tar.gz |
firewall3: fix left shift on 64 bit systems in fw3_bitlen2netmask
otherwise 0.0.0.0/0 is set as 0.0.0.0/255.255.255.255 on x86_64
Signed-off-by: Ulrich Weber <uw@ocedo.com>
-rw-r--r-- | utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -803,7 +803,7 @@ fw3_bitlen2netmask(int family, int bits, void *mask) return false; v4 = mask; - v4->s_addr = htonl(~((1 << (32 - abs(bits))) - 1)); + v4->s_addr = bits ? htonl(~((1 << (32 - abs(bits))) - 1)) : 0; if (bits < 0) v4->s_addr = ~v4->s_addr; |