iptables: optional loading of static extensions
[project/firewall3.git] / iptables.c
index 2a0d0ee29f453dba28025a269c917e76f9f7bb2c..fc22d1aae7bcb2e7ca763ab53a19d6b1eb42eff7 100644 (file)
@@ -29,12 +29,18 @@ static struct xtables_globals xtg = {
        .option_offset = 0,
        .program_version = "4",
        .orig_opts = base_opts,
+#if XTABLES_VERSION_CODE > 10
+       .compat_rev = xtables_compatible_revision,
+#endif
 };
 
 static struct xtables_globals xtg6 = {
        .option_offset = 0,
        .program_version = "6",
        .orig_opts = base_opts,
+#if XTABLES_VERSION_CODE > 10
+       .compat_rev = xtables_compatible_revision,
+#endif
 };
 
 static struct {
@@ -624,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);