]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
IDS: Add GREEN and BLUE addresses to the list of DNS servers.
authorStefan Schantl <stefan.schantl@ipfire.org>
Fri, 3 Apr 2020 14:59:12 +0000 (16:59 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Sun, 5 Apr 2020 07:35:08 +0000 (07:35 +0000)
Fixes #12349.

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

index af8a927e0bb04404338c4b166fc5688fdee783c9..7a2d98f038844d9cf8174d4f040d8d494dac6b79 100644 (file)
@@ -711,13 +711,28 @@ sub generate_dns_servers_file() {
        # Get the used DNS servers.
        my @nameservers = &General::get_nameservers();
 
+       # Get network settings.
+       my %netsettings;
+       &General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
+
        # Format dns servers declaration.
        my $line = "";
 
        # Check if the system has configured nameservers.
        if (@nameservers) {
+               # Add the GREEN address as DNS servers.
+               push(@nameservers, $netsettings{'GREEN_ADDRESS'});
+
+               # Check if a BLUE zone exists.
+               if ($netsettings{'BLUE_ADDRESS'}) {
+                       # Add the BLUE address to the array of nameservers.
+                       push(@nameservers, $netsettings{'BLUE_ADDRESS'});
+               }
+
+               # Generate the line which will be written to the DNS servers file.
                $line = join(",", @nameservers);
        } else {
+               # External net simply contains (any).
                $line = "\$EXTERNAL_NET";
        }