]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
nft: Embed rule's table name in nft_xt_ctx
authorPhil Sutter <phil@nwl.cc>
Tue, 20 Aug 2019 20:16:41 +0000 (22:16 +0200)
committerPhil Sutter <phil@nwl.cc>
Mon, 25 Nov 2019 22:31:10 +0000 (23:31 +0100)
Down to the point where expression parsing happens, the rule's table is
not known anymore but relevant if set lookups are required.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
iptables/nft-shared.c
iptables/nft-shared.h

index a67302ee621aea374675ea2ddc3f24d85f4eb7e8..19630c1e2990c755879fbcb429b2efc45c77d6d3 100644 (file)
@@ -597,6 +597,7 @@ void nft_rule_to_iptables_command_state(struct nft_handle *h,
        struct nft_xt_ctx ctx = {
                .cs = cs,
                .h = h,
+               .table = nftnl_rule_get_str(r, NFTNL_RULE_TABLE),
        };
 
        iter = nftnl_expr_iter_create(r);
index 4dc44b8460f0dd17ae2ae774ad91d0ab28e0438a..91762d2ed8a3e73bd6a0d50a509617da60c1542d 100644 (file)
@@ -51,6 +51,7 @@ struct nft_xt_ctx {
        struct nftnl_expr_iter *iter;
        struct nft_handle *h;
        uint32_t flags;
+       const char *table;
 
        uint32_t reg;
        struct {