From 2e6014c739852daf8c0c42caeef01d3966622c4b Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Mon, 27 Sep 2021 16:59:49 +0200 Subject: nft: Introduce builtin_tables_lookup() The set of builtin tables to use is fully determined by the given family so just look it up instead of having callers pass it explicitly. Signed-off-by: Phil Sutter --- iptables/xtables-restore.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'iptables/xtables-restore.c') diff --git a/iptables/xtables-restore.c b/iptables/xtables-restore.c index 72832103..86dcede3 100644 --- a/iptables/xtables-restore.c +++ b/iptables/xtables-restore.c @@ -281,7 +281,6 @@ void xtables_restore_parse(struct nft_handle *h, static int xtables_restore_main(int family, const char *progname, int argc, char *argv[]) { - const struct builtin_table *tables; struct nft_xt_restore_parse p = { .commit = true, .cb = &restore_cb, @@ -360,7 +359,6 @@ xtables_restore_main(int family, const char *progname, int argc, char *argv[]) switch (family) { case NFPROTO_IPV4: case NFPROTO_IPV6: /* fallthough, same table */ - tables = xtables_ipv4; #if defined(ALL_INCLUSIVE) || defined(NO_SHARED_LIBS) init_extensions(); init_extensions4(); @@ -368,17 +366,14 @@ xtables_restore_main(int family, const char *progname, int argc, char *argv[]) #endif break; case NFPROTO_ARP: - tables = xtables_arp; - break; case NFPROTO_BRIDGE: - tables = xtables_bridge; break; default: fprintf(stderr, "Unknown family %d\n", family); return 1; } - if (nft_init(&h, family, tables) < 0) { + if (nft_init(&h, family) < 0) { fprintf(stderr, "%s/%s Failed to initialize nft: %s\n", xtables_globals.program_name, xtables_globals.program_version, -- cgit v1.2.3