summaryrefslogtreecommitdiffstats
path: root/iptables/xtables-restore.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2022-03-15 12:45:04 +0100
committerPhil Sutter <phil@nwl.cc>2022-03-15 14:53:52 +0100
commitc293e116fc6130baae9ed82ca122b69ee6ff8390 (patch)
tree97ec9cc53ced82179bd31a61451c319ad826df0d /iptables/xtables-restore.c
parent0836524f093c0fd9c39604a46a949e43d9b47ef2 (diff)
nft: Review static extension loading
Combine the init_extensions() call common to all families, do not load IPv6 extensions for iptables and vice versa, drop the outdated comment about "same table". Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables/xtables-restore.c')
-rw-r--r--iptables/xtables-restore.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/iptables/xtables-restore.c b/iptables/xtables-restore.c
index 0250ed7d..b3cf4017 100644
--- a/iptables/xtables-restore.c
+++ b/iptables/xtables-restore.c
@@ -360,19 +360,18 @@ xtables_restore_main(int family, const char *progname, int argc, char *argv[])
p.in = stdin;
}
+ init_extensions();
switch (family) {
case NFPROTO_IPV4:
- case NFPROTO_IPV6: /* fallthough, same table */
- init_extensions();
init_extensions4();
+ break;
+ case NFPROTO_IPV6:
init_extensions6();
break;
case NFPROTO_ARP:
- init_extensions();
init_extensionsa();
break;
case NFPROTO_BRIDGE:
- init_extensions();
init_extensionsb();
break;
default: