diff options
author | Florian Westphal <fw@strlen.de> | 2012-05-10 22:11:54 +0000 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-05-17 00:56:31 +0200 |
commit | 1f27e2516c1d95ae19024bec5be68a3f489cc47e (patch) | |
tree | 9eeb1a8d5b8248ec36602198aeafaf9e07e7fcc5 /net | |
parent | 6d8823db422ae6719c7840fe11f737a40ffe4993 (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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index 5d5af1d04fa..26a668a84aa 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) return -EINVAL; } - if (info->cfg.mode >= XT_HASHLIMIT_MAX) { + if (info->cfg.mode & ~XT_HASHLIMIT_ALL) { pr_info("Unknown mode mask %X, kernel too old?\n", info->cfg.mode); return -EINVAL; |