提交 9d0db8b6 编写于 作者: P Pablo Neira Ayuso 提交者: Patrick McHardy

netfilter: arpt_mangle: fix return values of checkentry

In 135367b8 "netfilter: xtables: change xt_target.checkentry return type",
the type returned by checkentry was changed from boolean to int, but the
return values where not adjusted.

arptables: Input/output error

This broke arptables with the mangle target since it returns true
under success, which is interpreted by xtables as >0, thus
returning EIO.
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: NPatrick McHardy <kaber@trash.net>
上级 08b5194b
...@@ -60,12 +60,12 @@ static int checkentry(const struct xt_tgchk_param *par) ...@@ -60,12 +60,12 @@ static int checkentry(const struct xt_tgchk_param *par)
if (mangle->flags & ~ARPT_MANGLE_MASK || if (mangle->flags & ~ARPT_MANGLE_MASK ||
!(mangle->flags & ARPT_MANGLE_MASK)) !(mangle->flags & ARPT_MANGLE_MASK))
return false; return -EINVAL;
if (mangle->target != NF_DROP && mangle->target != NF_ACCEPT && if (mangle->target != NF_DROP && mangle->target != NF_ACCEPT &&
mangle->target != XT_CONTINUE) mangle->target != XT_CONTINUE)
return false; return -EINVAL;
return true; return 0;
} }
static struct xt_target arpt_mangle_reg __read_mostly = { static struct xt_target arpt_mangle_reg __read_mostly = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册