zones: allow untracked traffic as well
authorJo-Philipp Wich <jo@mein.io>
Mon, 8 Aug 2016 14:48:47 +0000 (16:48 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 8 Aug 2016 14:48:47 +0000 (16:48 +0200)
Now that we only allow ctstate NEW traffic by default we also need to
whitelist traffic explicitely marked by --notrack.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
zones.c

diff --git a/zones.c b/zones.c
index 368243564c306d6ad0c173b07efb3d0ca7e62db2..a4458fe5f7ea96b0248bb1ed70f7c459f56317a4 100644 (file)
--- a/zones.c
+++ b/zones.c
@@ -350,7 +350,8 @@ print_interface_rule(struct fw3_ipt_handle *handle, struct fw3_state *state,
                                fw3_ipt_rule_extra(r, zone->extra_src);
 
                                if (t == FW3_FLAG_ACCEPT && !state->defaults.drop_invalid)
-                                       fw3_ipt_rule_extra(r, "-m conntrack --ctstate NEW");
+                                       fw3_ipt_rule_extra(r,
+                                                          "-m conntrack --ctstate NEW,UNTRACKED");
 
                                fw3_ipt_rule_replace(r, "zone_%s_src_%s", zone->name,
                                                     fw3_flag_names[t]);
@@ -363,7 +364,8 @@ print_interface_rule(struct fw3_ipt_handle *handle, struct fw3_state *state,
                                fw3_ipt_rule_extra(r, zone->extra_dest);
 
                                if (t == FW3_FLAG_ACCEPT && !state->defaults.drop_invalid)
-                                       fw3_ipt_rule_extra(r, "-m conntrack --ctstate NEW");
+                                       fw3_ipt_rule_extra(r,
+                                                          "-m conntrack --ctstate NEW,UNTRACKED");
 
                                fw3_ipt_rule_replace(r, "zone_%s_dest_%s", zone->name,
                                                     fw3_flag_names[t]);