X-Git-Url: http://git.archive.openwrt.org/?p=project%2Ffirewall3.git;a=blobdiff_plain;f=utils.c;h=b2fbe0223c6d7338600654c09750a7d2a5b9622a;hp=71a0f13b269970d6162c6506ec161d43eeff2faf;hb=c03e20d7f594058ff223f30cf34de1b5e8210b8d;hpb=8ea29822ce53c36c91c7b67c6a99b2c50f2c373f diff --git a/utils.c b/utils.c index 71a0f13..b2fbe02 100644 --- a/utils.c +++ b/utils.c @@ -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;