C(ANY, MANGLE, UNSPEC, "mssfix"),
C(ANY, MANGLE, UNSPEC, "fwmark"),
- C(ANY, RAW, UNSPEC, "notrack"),
+ C(ANY, RAW, UNSPEC, "delegate_notrack"),
{ }
};
{ FW3_TABLE_MANGLE, "FORWARD", "mssfix" },
{ FW3_TABLE_MANGLE, "PREROUTING", "fwmark" },
- { FW3_TABLE_RAW, "PREROUTING", "notrack" },
+ { FW3_TABLE_RAW, "PREROUTING", "delegate_notrack" },
{ 0, NULL },
};
C(V4, NAT, SNAT, "zone_%s_postrouting"),
C(V4, NAT, DNAT, "zone_%s_prerouting"),
+ C(ANY, RAW, NOTRACK, "zone_%s_notrack"),
+
C(ANY, FILTER, CUSTOM_CHAINS, "input_%s_rule"),
C(ANY, FILTER, CUSTOM_CHAINS, "output_%s_rule"),
C(ANY, FILTER, CUSTOM_CHAINS, "forwarding_%s_rule"),
bool reload, struct fw3_zone *zone,
struct fw3_device *dev, struct fw3_address *sub)
{
- bool disable_notrack = state->defaults.drop_invalid;
struct fw3_protocol tcp = { .protocol = 6 };
struct fw3_ipt_rule *r;
enum fw3_flag t;
}
else if (handle->table == FW3_TABLE_RAW)
{
- if (!zone->conntrack && !disable_notrack)
+ if (has(zone->flags, handle->family, FW3_FLAG_NOTRACK))
{
r = fw3_ipt_rule_create(handle, NULL, dev, NULL, sub, NULL);
- fw3_ipt_rule_target(r, "CT");
- fw3_ipt_rule_addarg(r, false, "--notrack", NULL);
+ fw3_ipt_rule_target(r, "zone_%s_notrack", zone->name);
fw3_ipt_rule_extra(r, zone->extra_src);
- fw3_ipt_rule_append(r, "notrack");
+ fw3_ipt_rule_append(r, "delegate_notrack");
}
}
}
print_zone_rule(struct fw3_ipt_handle *handle, struct fw3_state *state,
bool reload, struct fw3_zone *zone)
{
+ bool disable_notrack = state->defaults.drop_invalid;
struct fw3_address *msrc;
struct fw3_address *mdest;
struct fw3_ipt_rule *r;
break;
case FW3_TABLE_RAW:
+ if (!zone->conntrack && !disable_notrack)
+ {
+ r = fw3_ipt_rule_new(handle);
+ fw3_ipt_rule_target(r, "CT");
+ fw3_ipt_rule_addarg(r, false, "--notrack", NULL);
+ fw3_ipt_rule_append(r, "zone_%s_notrack", zone->name);
+ }
+ break;
+
case FW3_TABLE_MANGLE:
break;
}