diff options
author | Florian Westphal <fw@strlen.de> | 2022-11-18 15:20:32 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2022-11-23 09:19:01 +0100 |
commit | 25883ce88bfba087ef142cb909d59dbbc1818b32 (patch) | |
tree | 06d7347a6239f9ef36aa6653df685264d03da5fc /iptables/nft-arp.c | |
parent | c9d41cefbe6eafb4a6b12c69fc1fa54b716d6c99 (diff) |
nft: check for unknown meta keys
Set ->errmsg when the meta key isn't supported by iptables-nft instead
of pretending everything is fine.
The old code is good enough to handle rules added by iptables-nft, but
its not enough to handle rules added by native nft.
At least make sure that there is a an error message telling that
iptables-nft could not decode the entire ruleset.
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'iptables/nft-arp.c')
-rw-r--r-- | iptables/nft-arp.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/iptables/nft-arp.c b/iptables/nft-arp.c index e9e11141..59f100af 100644 --- a/iptables/nft-arp.c +++ b/iptables/nft-arp.c @@ -168,11 +168,14 @@ static void nft_arp_parse_meta(struct nft_xt_ctx *ctx, struct arpt_entry *fw = &cs->arp; uint8_t flags = 0; - parse_meta(ctx, e, reg->meta_dreg.key, fw->arp.iniface, fw->arp.iniface_mask, + if (parse_meta(ctx, e, reg->meta_dreg.key, fw->arp.iniface, fw->arp.iniface_mask, fw->arp.outiface, fw->arp.outiface_mask, - &flags); + &flags) == 0) { + fw->arp.invflags |= flags; + return; + } - fw->arp.invflags |= flags; + ctx->errmsg = "Unknown arp meta key"; } static void parse_mask_ipv4(const struct nft_xt_ctx_reg *reg, struct in_addr *mask) |