Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D324C433F5 for ; Thu, 30 Sep 2021 14:05:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 172CD61440 for ; Thu, 30 Sep 2021 14:05:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351739AbhI3OGx (ORCPT ); Thu, 30 Sep 2021 10:06:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351734AbhI3OGw (ORCPT ); Thu, 30 Sep 2021 10:06:52 -0400 Received: from orbyte.nwl.cc (orbyte.nwl.cc [IPv6:2001:41d0:e:133a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63B1EC06176A for ; Thu, 30 Sep 2021 07:05:10 -0700 (PDT) Received: from localhost ([::1]:51702 helo=xic) by orbyte.nwl.cc with esmtp (Exim 4.94.2) (envelope-from ) id 1mVwgO-0007Qp-Q2; Thu, 30 Sep 2021 16:05:08 +0200 From: Phil Sutter To: Pablo Neira Ayuso Cc: netfilter-devel@vger.kernel.org Subject: [iptables PATCH v2 10/17] nft-shared: Make nft_check_xt_legacy() family agnostic Date: Thu, 30 Sep 2021 16:04:12 +0200 Message-Id: <20210930140419.6170-11-phil@nwl.cc> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210930140419.6170-1-phil@nwl.cc> References: <20210930140419.6170-1-phil@nwl.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Of course there is no such thing as *_tables_names for ebtables, so no legacy tables checking for ebtables-nft. Signed-off-by: Phil Sutter --- iptables/nft-shared.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/iptables/nft-shared.c b/iptables/nft-shared.c index 4253b08196d29..72727270026ee 100644 --- a/iptables/nft-shared.c +++ b/iptables/nft-shared.c @@ -992,6 +992,7 @@ void nft_check_xt_legacy(int family, bool is_ipt_save) { static const char tables6[] = "/proc/net/ip6_tables_names"; static const char tables4[] = "/proc/net/ip_tables_names"; + static const char tablesa[] = "/proc/net/arp_tables_names"; const char *prefix = "ip"; FILE *fp = NULL; char buf[1024]; @@ -1004,6 +1005,10 @@ void nft_check_xt_legacy(int family, bool is_ipt_save) fp = fopen(tables6, "r"); prefix = "ip6"; break; + case NFPROTO_ARP: + fp = fopen(tablesa, "r"); + prefix = "arp"; + break; default: break; } -- 2.33.0