]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
nft-shared: Make nft_check_xt_legacy() family agnostic
authorPhil Sutter <phil@nwl.cc>
Mon, 27 Sep 2021 14:59:49 +0000 (16:59 +0200)
committerPhil Sutter <phil@nwl.cc>
Wed, 20 Oct 2021 09:32:54 +0000 (11:32 +0200)
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 <phil@nwl.cc>
iptables/nft-shared.c

index 4253b08196d295309934c487b2c751a8ed601282..72727270026eebdc08480c6c484a6aa5dcbe50e5 100644 (file)
@@ -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;
        }