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:
Jan Engelhardt
2008-03-17 15:36:59 +01:00
parent 93c7d0ac47
commit 8c58a61f52

View File

@@ -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;
}