From: Stefan Schantl Date: Wed, 30 Jan 2019 11:04:54 +0000 (+0100) Subject: ids-functions.pl: Add RED address and aliases to the HOME_NET X-Git-Tag: v2.23-core131~117^2~82 X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff_plain;h=23c0347ac5d386e215c56ae9fa3af97e66f1c23f ids-functions.pl: Add RED address and aliases to the HOME_NET Reference: #11981 Signed-off-by: Stefan Schantl --- diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl index 114d5763db..a7c1585228 100644 --- a/config/cfgroot/ids-functions.pl +++ b/config/cfgroot/ids-functions.pl @@ -597,9 +597,6 @@ sub generate_home_net_file() { # Loop through the array of available network zones. foreach my $zone (@network_zones) { - # Skip the red network - It never can be part to the home_net! - next if($zone eq "red"); - # Convert current zone name into upper case. $zone = uc($zone); @@ -622,6 +619,24 @@ sub generate_home_net_file() { # Add the generated network to the array of networks. push(@networks, $network); } + + # Check if the current processed zone is red. + if($zone eq "RED") { + # Check if the configured RED_TYPE is static. + if ($netsettings{'RED_TYPE'} eq "STATIC") { + # Get configured and enabled aliases. + my @aliases = &get_aliases(); + + # Loop through the array. + foreach my $alias (@aliases) { + # Add "/32" prefix. + my $network = join("/", $alias, "32"); + + # Add the generated network to the array of networks. + push(@networks, $network); + } + } + } } # Format home net declaration.