X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Frouting.cgi;h=f2014e2e12f917ecc31c56c7490534a52a420874;hp=2c60f67cdfc4e7982ea7d5c60ad0d446eb17b24c;hb=51141b150d5fd2a51ae75f32fe23ce2eb79558e6;hpb=6be114f03a12086211234c05a4f7801416488c67 diff --git a/html/cgi-bin/routing.cgi b/html/cgi-bin/routing.cgi index 2c60f67cdf..f2014e2e12 100644 --- a/html/cgi-bin/routing.cgi +++ b/html/cgi-bin/routing.cgi @@ -118,10 +118,9 @@ if ($settings{'ACTION'} eq $Lang::tr{'toggle enable disable'}) { } if ($settings{'ACTION'} eq $Lang::tr{'add'}) { - # Validate inputs - if (!&General::validipandmask($settings{'IP'}))){ - $errormessage = $Lang::tr{'invalid ip'}." / ".$Lang::tr{'invalid netmask'}; + if (!&General::validipandmask($settings{'IP'})){ + $errormessage = $Lang::tr{'invalid ip'}." / ".$Lang::tr{'invalid netmask'}; }else{ #set networkip if not already correctly defined my($ip,$cidr) = split(/\//,$settings{'IP'}); @@ -150,12 +149,12 @@ if ($settings{'ACTION'} eq $Lang::tr{'add'}) { $temp[2] ='' unless defined $temp[2]; # not always populated $temp[3] ='' unless defined $temp[2]; # not always populated #Same ip already used? - if($temp[1] eq $settings{'IP'}){ + if($temp[1] eq $settings{'IP'} && $settings{'KEY1'} eq ''){ $errormessage = $Lang::tr{'ccd err irouteexist'}; last; } #Is the network part of an internal network? - $errormessage .= &General::check_net_internal($settings{'IP'}); + $errormessage .= &General::check_net_internal_exact($settings{'IP'}); last; }