summaryrefslogtreecommitdiffstats
path: root/iptables/xtables-translate.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-translate.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-translate.c')
-rw-r--r--iptables/xtables-translate.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/iptables/xtables-translate.c b/iptables/xtables-translate.c
index 07a9c1be..d1e87f16 100644
--- a/iptables/xtables-translate.c
+++ b/iptables/xtables-translate.c
@@ -485,19 +485,18 @@ static int xtables_xlate_main_common(struct nft_handle *h,
xtables_globals.program_version);
return 1;
}
+ init_extensions();
switch (family) {
case NFPROTO_IPV4:
- case NFPROTO_IPV6: /* fallthrough: 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: