Skip to content

Commit

Permalink
netfilter: arpt_mangle: fix return values of checkentry
Browse files Browse the repository at this point in the history
In 135367b "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: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
  • Loading branch information
Pablo Neira Ayuso authored and Patrick McHardy committed Feb 1, 2011
1 parent 08b5194 commit 9d0db8b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/ipv4/netfilter/arpt_mangle.c
Original file line number Diff line number Diff line change
@@ -60,12 +60,12 @@ static int checkentry(const struct xt_tgchk_param *par)

if (mangle->flags & ~ARPT_MANGLE_MASK ||
!(mangle->flags & ARPT_MANGLE_MASK))
return false;
return -EINVAL;

if (mangle->target != NF_DROP && mangle->target != NF_ACCEPT &&
mangle->target != XT_CONTINUE)
return false;
return true;
return -EINVAL;
return 0;
}

static struct xt_target arpt_mangle_reg __read_mostly = {

0 comments on commit 9d0db8b

Please sign in to comment.