]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
suricata: Store bypass flag in connmark and restore
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 18 Oct 2021 10:10:20 +0000 (10:10 +0000)
committerArne Fitzenreiter <arne_f@ipfire.org>
Tue, 19 Oct 2021 11:34:54 +0000 (11:34 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Tested-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
src/initscripts/system/suricata

index 2577621b8f0617e5b01c8bd60ddd8361c3d2572e..72d01b91dab82df662178ec9d36b2c651ecf377d 100644 (file)
@@ -154,10 +154,14 @@ function generate_fw_rules {
                        done
                done
 
-               # Clear repeat bit, so that it does not confuse IPsec or QoS
-               iptables -w -A "${IPS_INPUT_CHAIN}" -j MARK --set-xmark "0x0/${REPEAT_MASK}"
-               iptables -w -A "${IPS_FORWARD_CHAIN}" -j MARK --set-xmark "0x0/${REPEAT_MASK}"
-               iptables -w -A "${IPS_OUTPUT_CHAIN}" -j MARK --set-xmark "0x0/${REPEAT_MASK}"
+               # Add common rules at the end of the chain
+               for chain in "${IPS_INPUT_CHAIN}" "${IPS_FORWARD_CHAIN}" "${IPS_OUTPUT_CHAIN}"; do
+                       # Clear repeat bit
+                       iptables -w -A "${chain}" -j MARK --set-xmark "0x0/${REPEAT_MASK}"
+
+                       # Store bypass bit in CONNMARK
+                       iptables -w -A "${chain}" -m mark --mark "${BYPASS_MARK}/${BYPASS_MASK}" -j CONNMARK --save-mark
+               done
        fi
 }