diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2023-07-11 22:06:44 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2023-07-12 16:17:16 +0200 |
commit | 4e95200ded923f0eb5579c33b91176193c59dbe0 (patch) | |
tree | 8b83c9ab49e2b1840c1818e68b08a1a1f220e283 /iptables/nft-shared.h | |
parent | 82ccfb488eeac5507471099b9b4e6d136cc06e3b (diff) |
nft-bridge: pass context structure to ops->add() to improve anonymous set support
Add context structure to improve bridge among support which creates an
anonymous set. This context structure specifies the command and it
allows to optionally store a anonymous set.
Use this context to generate native bytecode only if this is an
add/insert/replace command.
This fixes a dangling anonymous set that is created on rule removal.
Fixes: 26753888720d ("nft: bridge: Rudimental among extension support")
Reported-and-tested-by: Igor Raits <igor@gooddata.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables/nft-shared.h')
-rw-r--r-- | iptables/nft-shared.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/iptables/nft-shared.h b/iptables/nft-shared.h index a06b263d..4f47058d 100644 --- a/iptables/nft-shared.h +++ b/iptables/nft-shared.h @@ -35,13 +35,14 @@ | FMT_NUMERIC | FMT_NOTABLE) #define FMT(tab,notab) ((format) & FMT_NOTABLE ? (notab) : (tab)) +struct nft_rule_ctx; struct xtables_args; struct nft_handle; struct xt_xlate; struct nft_family_ops { - int (*add)(struct nft_handle *h, struct nftnl_rule *r, - struct iptables_command_state *cs); + int (*add)(struct nft_handle *h, struct nft_rule_ctx *ctx, + struct nftnl_rule *r, struct iptables_command_state *cs); bool (*is_same)(const struct iptables_command_state *cs_a, const struct iptables_command_state *cs_b); void (*print_payload)(struct nftnl_expr *e, |