From aa5fa3185791aac71c9172d4fda3e8729164b5d1 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 18 Mar 2010 00:44:52 +0100 Subject: netfilter: xtables: make use of caller family rather than match family The matches can have .family = NFPROTO_UNSPEC, and though that is not the case for the touched modules, it seems better to just use the nfproto from the caller. Signed-off-by: Jan Engelhardt --- net/netfilter/xt_hashlimit.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'net/netfilter/xt_hashlimit.c') diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index ba9601a767aa..1fdb50a90f1c 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c @@ -703,8 +703,8 @@ static bool hashlimit_mt_check_v0(const struct xt_mtchk_param *par) return false; mutex_lock(&hashlimit_mutex); - r->hinfo = htable_find_get(net, r->name, par->match->family); - if (!r->hinfo && htable_create_v0(net, r, par->match->family) != 0) { + r->hinfo = htable_find_get(net, r->name, par->family); + if (!r->hinfo && htable_create_v0(net, r, par->family) != 0) { mutex_unlock(&hashlimit_mutex); return false; } @@ -730,7 +730,7 @@ static bool hashlimit_mt_check(const struct xt_mtchk_param *par) return false; if (info->name[sizeof(info->name)-1] != '\0') return false; - if (par->match->family == NFPROTO_IPV4) { + if (par->family == NFPROTO_IPV4) { if (info->cfg.srcmask > 32 || info->cfg.dstmask > 32) return false; } else { @@ -739,8 +739,8 @@ static bool hashlimit_mt_check(const struct xt_mtchk_param *par) } mutex_lock(&hashlimit_mutex); - info->hinfo = htable_find_get(net, info->name, par->match->family); - if (!info->hinfo && htable_create(net, info, par->match->family) != 0) { + info->hinfo = htable_find_get(net, info->name, par->family); + if (!info->hinfo && htable_create(net, info, par->family) != 0) { mutex_unlock(&hashlimit_mutex); return false; } -- cgit v1.2.3