]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
BUG11131: fix errormessage when more ipsec subnets defined
authorHeino Gutschmidt <heino.gutschmidt@managedhosting.de>
Thu, 2 Jun 2016 14:39:35 +0000 (16:39 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 3 Jun 2016 15:19:49 +0000 (16:19 +0100)
When having more than one subnet in an ipsec connection it is not
possible to create a new openvpn static subnet.

Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
Signed-off-by: Heino Gutschmidt <heino.gutschmidt@managedhosting.de>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/cfgroot/general-functions.pl

index d3d725131f5be2822652a2b02ac694dda3cef9c1..298e68c5a4cc138cb6f0af048f0d341638d06959 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;
+                                               }
                                        }
                                }
                        }