mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-07 13:15:12 +02:00
geoip: address comparison is inclusive
subnet is somewhat a wrong term, geoip actually uses ipranges. Either way, the comparison needs to be >= and <= instead of > <.
This commit is contained in:
@@ -137,7 +137,8 @@ static bool xt_geoip_mt(const struct sk_buff *skb, const struct net_device *in,
|
||||
}
|
||||
|
||||
for (j = 0; j < node->count; j++)
|
||||
if ((ip > node->subnets[j].begin) && (ip < node->subnets[j].end)) {
|
||||
if (ip >= node->subnets[j].begin &&
|
||||
ip <= node->subnets[j].end) {
|
||||
spin_unlock_bh(&geoip_lock);
|
||||
return (info->flags & XT_GEOIP_INV) ? 0 : 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user