]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
ids-functions.pl: Fix generating of HOME_NET declaration
authorStefan Schantl <stefan.schantl@ipfire.org>
Mon, 18 May 2020 19:15:54 +0000 (21:15 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Mon, 18 May 2020 20:09:07 +0000 (20:09 +0000)
Fixes #12407.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
config/cfgroot/ids-functions.pl

index f124b12be66ec0c54e4900561f03d3b4da603910..e33569849975ebf2363e9e736849ab90681ddd94 100644 (file)
@@ -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";