]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - config/cfgroot/general-functions.pl
DNS: Show DNSSEC status on index page if deavtivated
[people/pmueller/ipfire-2.x.git] / config / cfgroot / general-functions.pl
index d3d725131f5be2822652a2b02ac694dda3cef9c1..5e5417d0971f4ec19f93a0d724611681e4831042 100644 (file)
@@ -516,12 +516,14 @@ sub checksubnets
                &General::readhasharray("${General::swroot}/vpn/config", \%ipsecconf);
                foreach my $key (keys %ipsecconf){
                        if ($ipsecconf{$key}[11] ne ''){
-                               my ($ipsecip,$ipsecsub) = split (/\//, $ipsecconf{$key}[11]);
-                               $ipsecsub=&iporsubtodec($ipsecsub);
-                               if($ipsecconf{$key}[1] ne $ccdname){
-                                       if ( &IpInSubnet ($ip,$ipsecip,$ipsecsub) ){
-                                               $errormessage=$Lang::tr{'ccd err isipsecnet'}." Name:  $ipsecconf{$key}[1]";
-                                               return $errormessage;
+                               foreach my $ipsecsubitem (split(/\|/, $ipsecconf{$key}[11])) {
+                                       my ($ipsecip,$ipsecsub) = split (/\//, $ipsecconf{$key}[11]);
+                                       $ipsecsub=&iporsubtodec($ipsecsub);
+                                       if($ipsecconf{$key}[1] ne $ccdname){
+                                               if ( &IpInSubnet ($ip,$ipsecip,$ipsecsub) ){
+                                                       $errormessage=$Lang::tr{'ccd err isipsecnet'}." Name:  $ipsecconf{$key}[1]";
+                                                       return $errormessage;
+                                               }
                                        }
                                }
                        }
@@ -538,13 +540,9 @@ sub checksubnets
                        return $errormessage;
                }
        }
-
-       #check if we use one of ipfire's networks (green,orange,blue)
-       &readhash("${General::swroot}/ethernet/settings", \%ownnet);
-       if (($ownnet{'GREEN_NETADDRESS'}        ne '' && $ownnet{'GREEN_NETADDRESS'}    ne '0.0.0.0') && &IpInSubnet($ip,$ownnet{'GREEN_NETADDRESS'},&iporsubtodec($ownnet{'GREEN_NETMASK'}))){ $errormessage=$Lang::tr{'ccd err green'};return $errormessage;}
-       if (($ownnet{'ORANGE_NETADDRESS'}       ne '' && $ownnet{'ORANGE_NETADDRESS'}   ne '0.0.0.0') && &IpInSubnet($ip,$ownnet{'ORANGE_NETADDRESS'},&iporsubtodec($ownnet{'ORANGE_NETMASK'}))){ $errormessage=$Lang::tr{'ccd err orange'};return $errormessage;}
-       if (($ownnet{'BLUE_NETADDRESS'}         ne '' && $ownnet{'BLUE_NETADDRESS'}     ne '0.0.0.0') && &IpInSubnet($ip,$ownnet{'BLUE_NETADDRESS'},&iporsubtodec($ownnet{'BLUE_NETMASK'}))){ $errormessage=$Lang::tr{'ccd err blue'};return $errormessage;}
-       if (($ownnet{'RED_NETADDRESS'}          ne '' && $ownnet{'RED_NETADDRESS'}              ne '0.0.0.0') && &IpInSubnet($ip,$ownnet{'RED_NETADDRESS'},&iporsubtodec($ownnet{'RED_NETMASK'}))){ $errormessage=$Lang::tr{'ccd err red'};return $errormessage;}
+       
+       #call check_net_internal
+       &General::check_net_internal($ccdnet);
 }
 
 sub check_net_internal{
@@ -1130,4 +1128,16 @@ sub get_red_interface() {
        return $interface;
 }
 
+sub dnssec_status() {
+       my $path = "${General::swroot}/red/dnssec-status";
+
+       open(STATUS, $path) or return 0;
+       my $status = <STATUS>;
+       close(STATUS);
+
+       chomp($status);
+
+       return $status;
+}
+
 1;