From ac2f710771ba327b5b8fd1b8f3829b977d08aa24 Mon Sep 17 00:00:00 2001 From: Alexander Marx Date: Thu, 3 Jan 2013 06:36:33 +0100 Subject: [PATCH] OpenVPN CCD: Fixes Bug when editing an IPsec Net, the ipcheck did not return a ipsecnet name. --- config/cfgroot/general-functions.pl | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl index d08a87a22d..f94cdbf16c 100644 --- a/config/cfgroot/general-functions.pl +++ b/config/cfgroot/general-functions.pl @@ -408,19 +408,16 @@ sub checksubnets my $errormessage; my ($ip,$cidr)=split(/\//,$ccdnet); $cidr=&iporsubtocidr($cidr); - #get OVPN-Subnet (dynamic range) my %ovpnconf=(); &readhash("${General::swroot}/ovpn/settings", \%ovpnconf); my ($ovpnip,$ovpncidr)= split (/\//,$ovpnconf{'DOVPN_SUBNET'}); $ovpncidr=&iporsubtocidr($ovpncidr); - #check if we try to use same network as ovpn server if ("$ip/$cidr" eq "$ovpnip/$ovpncidr") { $errormessage=$errormessage.$Lang::tr{'ccd err isovpnnet'}."
"; return $errormessage; } - #check if we use a network-name/subnet that already exists &readhasharray("${General::swroot}/ovpn/ccd.conf", \%ccdconfhash); foreach my $key (keys %ccdconfhash) { @@ -436,9 +433,7 @@ sub checksubnets $errormessage=$errormessage.$Lang::tr{'ccd err issubnet'}."
"; return $errormessage; } - } - #check if we use a ipsec right network which is already defined my %ipsecconf=(); &General::readhasharray("${General::swroot}/vpn/config", \%ipsecconf); @@ -448,13 +443,12 @@ sub checksubnets $ipsecsub=&iporsubtodec($ipsecsub); if($ipsecconf{$key}[1] ne $ccdname){ if ( &IpInSubnet ($ip,$ipsecip,$ipsecsub) ){ - $errormessage=$Lang::tr{'ccd err isipsecnet'}." Name: $ipsecconf{$key}[2]"; + $errormessage=$Lang::tr{'ccd err isipsecnet'}." Name: $ipsecconf{$key}[1]"; return $errormessage; } } } } - #check if we use one of ipfire's networks (green,orange,blue) my %ownnet=(); &readhash("${General::swroot}/ethernet/settings", \%ownnet); @@ -462,9 +456,6 @@ sub checksubnets if (($ownnet{'ORANGE_NETADDRESS'} ne '' && $ownnet{'ORANGE_NETADDRESS'} ne '0.0.0.0') && &IpInSubnet($ownnet{'ORANGE_NETADDRESS'},$ip,&iporsubtodec($cidr))){ $errormessage=$Lang::tr{'ccd err orange'};return $errormessage;} if (($ownnet{'BLUE_NETADDRESS'} ne '' && $ownnet{'BLUE_NETADDRESS'} ne '0.0.0.0') && &IpInSubnet($ownnet{'BLUE_NETADDRESS'},$ip,&iporsubtodec($cidr))){ $errormessage=$Lang::tr{'ccd err blue'};return $errormessage;} if (($ownnet{'RED_NETADDRESS'} ne '' && $ownnet{'RED_NETADDRESS'} ne '0.0.0.0') && &IpInSubnet($ownnet{'RED_NETADDRESS'},$ip,&iporsubtodec($cidr))){ $errormessage=$Lang::tr{'ccd err red'};return $errormessage;} - - - } -- 2.39.2