ids-functions.pl: Fix generating of HOME_NET declaration

Message ID 20200518191554.3083-1-stefan.schantl@ipfire.org
State Accepted
Commit adb320bc4a834db81137c3b9b8c2158e54f0a615
Headers
Series ids-functions.pl: Fix generating of HOME_NET declaration |

Commit Message

Stefan Schantl May 18, 2020, 7:15 p.m. UTC
  Fixes #12407.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
 config/cfgroot/ids-functions.pl | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)
  

Patch

diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl
index f124b12be..e33569849 100644
--- a/config/cfgroot/ids-functions.pl
+++ b/config/cfgroot/ids-functions.pl
@@ -677,22 +677,7 @@  sub generate_home_net_file() {
 	}
 
 	# Format home net declaration.
-	my $line = "\"\[";
-
-	# Loop through the array of networks.
-	foreach my $network (@networks) {
-		# Add the network to the line.
-		$line = "$line" . "$network";
-
-		# Check if the current network was the last in the array.
-		if ($network eq $networks[-1]) {
-			# Close the line.
-			$line = "$line" . "\]\"";
-		} else {
-			# Add "," for the next network.
-			$line = "$line" . "\,";
-		}
-	}
+	my $line = "[" . join(',', @networks) . "]";
 
 	# Open file to store the addresses of the home net.
 	open(FILE, ">$homenet_file") or die "Could not open $homenet_file. $!\n";