};
+static bool
+need_src_action_chain(struct fw3_rule *r)
+{
+ return (r->_src && r->_src->log && (r->target > FW3_FLAG_ACCEPT));
+}
+
void
fw3_load_rules(struct fw3_state *state, struct uci_package *p)
{
setbit(rule->_dest->flags[0], rule->target);
setbit(rule->_dest->flags[1], rule->target);
}
- else if (rule->_src)
+ else if (need_src_action_chain(rule))
{
setbit(rule->_src->flags[0], fw3_to_src_target(rule->target));
setbit(rule->_src->flags[1], fw3_to_src_target(rule->target));
if (rule->dest.set && !rule->dest.any)
fw3_ipt_rule_target(r, "zone_%s_dest_%s", rule->dest.name, name);
- else if (rule->src.set && !rule->src.any)
+ else if (need_src_action_chain(rule))
fw3_ipt_rule_target(r, "zone_%s_src_%s", rule->src.name, name);
else
fw3_ipt_rule_target(r, name);