From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCHv2] suricata: Do not create silly forward rules. Date: Wed, 06 Apr 2022 21:23:32 +0200 Message-ID: <20220406192332.4865-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7990180840541283993==" List-Id: --===============7990180840541283993== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Skip creating forward rules if the input and the output device are the same. Signed-off-by: Stefan Schantl --- src/initscripts/system/suricata | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/initscripts/system/suricata b/src/initscripts/system/suricata index 5ede405ce..79c105c23 100644 --- a/src/initscripts/system/suricata +++ b/src/initscripts/system/suricata @@ -171,6 +171,11 @@ function generate_fw_rules { # Create rules which are required to handle forwarded traffic. for enabled_ips_zone_forward in "${enabled_ips_zones[@]}"; do + # Skip loop iteration if both zones are the same. + if [ "$enabled_ips_zone" == "$enabled_ips_zone_forward" ]; then + continue + fi + # Check if the whetelist file is not empty. if [ -s "$WHITELIST_FILE" ]; then # Create rules to handle whitelisted hosts. -- 2.30.2 --===============7990180840541283993==--