From 010723ef8af18add1e592a55092d4b0e1c5e1efe Mon Sep 17 00:00:00 2001 From: Ralph Sennhauser Date: Sat, 5 Nov 2016 17:40:38 +0100 Subject: [PATCH] iptables: fix loading standard target In case iptables is built with --disable-static xt_standard needs to be loaded just like the other extensions. Signed-off-by: Ralph Sennhauser [Jo-Philipp Wich: minor code style change to if/return instead of if/else] Signed-off-by: Jo-Philipp Wich --- iptables.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/iptables.c b/iptables.c index 95fc0d4..fc22d1a 100644 --- a/iptables.c +++ b/iptables.c @@ -630,8 +630,15 @@ find_target(struct fw3_ipt_rule *r, const char *name) { struct xtables_target *t; - if (is_chain(r->h, name)) + if (is_chain(r->h, name)) { + t = xtables_find_target(XT_STANDARD_TARGET, XTF_DONT_LOAD); + + if (t) + return t; + + load_extension(r->h, "standard"); return xtables_find_target(XT_STANDARD_TARGET, XTF_LOAD_MUST_SUCCEED); + } t = xtables_find_target(name, XTF_DONT_LOAD); -- 2.25.1