Fix output rules with "option dest *"
authorJo-Philipp Wich <jow@openwrt.org>
Sat, 25 May 2013 16:08:20 +0000 (18:08 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Sat, 25 May 2013 16:14:57 +0000 (18:14 +0200)
rules.c

diff --git a/rules.c b/rules.c
index 0f4e925765931bf3a4c09f147a87e80208aa7594..eea872496e5e42c25d9116d8aa755637161b710f 100644 (file)
--- a/rules.c
+++ b/rules.c
@@ -245,7 +245,13 @@ append_chain(struct fw3_ipt_rule *r, struct fw3_rule *rule)
                }
 
                if (rule->dest.set && !rule->src.set)
-                       snprintf(chain, sizeof(chain), "zone_%s_output", rule->dest.name);
+               {
+                       if (rule->dest.any)
+                               snprintf(chain, sizeof(chain), "delegate_output");
+                       else
+                               snprintf(chain, sizeof(chain), "zone_%s_output",
+                                        rule->dest.name);
+               }
        }
 
        fw3_ipt_rule_append(r, chain);