[3/4] rules.pl: Do not create HOSTILE rules if no red dev is available.

Message ID 20220309141232.2401848-3-stefan.schantl@ipfire.org
State Accepted
Commit 74659290e938e2fa3a006b6e8181042bedd5f76a
Headers
Series [1/4] libloc: Update to 0.9.11 |

Commit Message

Stefan Schantl March 9, 2022, 2:12 p.m. UTC
  Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
 config/firewall/rules.pl | 3 +++
 1 file changed, 3 insertions(+)
  

Patch

diff --git a/config/firewall/rules.pl b/config/firewall/rules.pl
index 83216e78a..57f4809b4 100644
--- a/config/firewall/rules.pl
+++ b/config/firewall/rules.pl
@@ -695,6 +695,9 @@  sub drop_hostile_networks () {
 		return;
 	}
 
+	# Exit if there is no red interface.
+	return unless($RED_DEV);
+
 	# Call function to load the network list of hostile networks.
 	&ipset_restore($HOSTILE_CCODE);