summaryrefslogtreecommitdiffstats
path: root/extensions/libxt_MARK.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2023-11-07 12:15:40 +0100
committerPhil Sutter <phil@nwl.cc>2023-11-07 23:40:14 +0100
commita3ae0dc4b34046e0d7893841e86b93c4c010632f (patch)
tree36aaee979fcb94cd57b932773d376356e0648bfa /extensions/libxt_MARK.c
parent50f40b2c05e11ab0276b2dd6d860855968358bb5 (diff)
extensions: MARK: fix arptables support
arptables "--set-mark" is really just "--or-mark". This bug is also in arptables-legacy. Fix this and add test cases. Note that the test for "16" vs. "0x16" is intentional, arptables parser is buggy and always uses "%x". Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'extensions/libxt_MARK.c')
-rw-r--r--extensions/libxt_MARK.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/extensions/libxt_MARK.c b/extensions/libxt_MARK.c
index 100f6a38..d6eacfcb 100644
--- a/extensions/libxt_MARK.c
+++ b/extensions/libxt_MARK.c
@@ -290,6 +290,7 @@ mark_tg_arp_parse(int c, char **argv, int invert, unsigned int *flags,
return 0;
}
info->mark = i;
+ info->mask = 0xffffffffU;
if (*flags)
xtables_error(PARAMETER_PROBLEM,
"MARK: Can't specify --set-mark twice");
@@ -430,6 +431,7 @@ static struct xtables_target mark_tg_reg[] = {
.save = mark_tg_arp_save,
.parse = mark_tg_arp_parse,
.extra_opts = mark_tg_arp_opts,
+ .xlate = mark_tg_xlate,
},
};