projects
/
oweals
/
firewall3.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9e7b836
)
Fix processing of CIDRs with mask 0
author
Jo-Philipp Wich
<jow@openwrt.org>
Tue, 18 Jun 2013 14:11:56 +0000
(16:11 +0200)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Tue, 18 Jun 2013 14:11:56 +0000
(16:11 +0200)
iptables.c
patch
|
blob
|
history
diff --git
a/iptables.c
b/iptables.c
index df0d70425eaf4cc48dd9c382f2a88d83477ea01e..7d91452ff6f455cd3551a08cbe38c1d1590109b3 100644
(file)
--- a/
iptables.c
+++ b/
iptables.c
@@
-609,7
+609,10
@@
fw3_ipt_rule_in_out(struct fw3_ipt_rule *r,
static void
ip4prefix2mask(int prefix, struct in_addr *mask)
{
- mask->s_addr = htonl(~((1 << (32 - prefix)) - 1));
+ if (prefix > 0)
+ mask->s_addr = htonl(~((1 << (32 - prefix)) - 1));
+ else
+ mask->s_addr = 0;
}
#ifndef DISABLE_IPV6