aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2012-05-10 18:11:54 -0400
committerPablo Neira Ayuso <pablo@netfilter.org>2012-05-16 18:56:31 -0400
commit1f27e2516c1d95ae19024bec5be68a3f489cc47e (patch)
tree9eeb1a8d5b8248ec36602198aeafaf9e07e7fcc5 /net
parent6d8823db422ae6719c7840fe11f737a40ffe4993 (diff)
netfilter: xt_hashlimit: use _ALL macro to reject unknown flag bits
David Miller says: The canonical way to validate if the set bits are in a valid range is to have a "_ALL" macro, and test: if (val & ~XT_HASHLIMIT_ALL) goto err;" make it so. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/xt_hashlimit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
index 5d5af1d04fa2..26a668a84aa2 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
@@ -647,7 +647,7 @@ static int hashlimit_mt_check(const struct xt_mtchk_param *par)
647 return -EINVAL; 647 return -EINVAL;
648 } 648 }
649 649
650 if (info->cfg.mode >= XT_HASHLIMIT_MAX) { 650 if (info->cfg.mode & ~XT_HASHLIMIT_ALL) {
651 pr_info("Unknown mode mask %X, kernel too old?\n", 651 pr_info("Unknown mode mask %X, kernel too old?\n",
652 info->cfg.mode); 652 info->cfg.mode);
653 return -EINVAL; 653 return -EINVAL;