From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD754C4360C for ; Fri, 27 Sep 2019 14:05:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AAF33217D7 for ; Fri, 27 Sep 2019 14:05:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727355AbfI0OFR (ORCPT ); Fri, 27 Sep 2019 10:05:17 -0400 Received: from orbyte.nwl.cc ([151.80.46.58]:50012 "EHLO orbyte.nwl.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726163AbfI0OFR (ORCPT ); Fri, 27 Sep 2019 10:05:17 -0400 Received: from localhost ([::1]:34870 helo=tatos) by orbyte.nwl.cc with esmtp (Exim 4.91) (envelope-from ) id 1iDqrz-0006w5-Rd; Fri, 27 Sep 2019 16:05:15 +0200 From: Phil Sutter To: Pablo Neira Ayuso Cc: netfilter-devel@vger.kernel.org Subject: [iptables PATCH v2 10/12] nft: Embed rule's table name in nft_xt_ctx Date: Fri, 27 Sep 2019 16:04:31 +0200 Message-Id: <20190927140433.9504-11-phil@nwl.cc> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190927140433.9504-1-phil@nwl.cc> References: <20190927140433.9504-1-phil@nwl.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org 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 --- iptables/nft-shared.c | 1 + iptables/nft-shared.h | 1 + 2 files changed, 2 insertions(+) diff --git a/iptables/nft-shared.c b/iptables/nft-shared.c index a67302ee621ae..19630c1e2990c 100644 --- a/iptables/nft-shared.c +++ b/iptables/nft-shared.c @@ -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); diff --git a/iptables/nft-shared.h b/iptables/nft-shared.h index 684d7e40c3bf3..55e7f3c7c1da4 100644 --- a/iptables/nft-shared.h +++ b/iptables/nft-shared.h @@ -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 { -- 2.23.0