From 5eee5a607e213c25b350926c5234d2230cfc6e29 Mon Sep 17 00:00:00 2001 From: Alexander Marx Date: Wed, 26 Feb 2014 16:07:02 +0100 Subject: [PATCH 1/1] QOS: IP-Addresses can now be simple IP-Address or IP-Address and subnet --- html/cgi-bin/qos.cgi | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/html/cgi-bin/qos.cgi b/html/cgi-bin/qos.cgi index dee6f41bd..6d4d025bf 100644 --- a/html/cgi-bin/qos.cgi +++ b/html/cgi-bin/qos.cgi @@ -251,15 +251,29 @@ END if ($qossettings{'DOLEVEL7'} eq $Lang::tr{'save'}) { if ( $qossettings{'QIP'} ne '' ) { - unless ( &General::validip($qossettings{'QIP'}) ) { - $qossettings{'VALID'} = 'no'; - $message = $Lang::tr{'The source IP address is invalid.'}; + if ($qossettings{'QIP'} =~ /^(.*?)\/(.*?)$/){ + if (! &General::validipandmask($qossettings{'QIP'}) ) { + $qossettings{'VALID'} = 'no'; + $message = $Lang::tr{'The source IP address is invalid.'}; + } + }else{ + if ( &General::validip($qossettings{'QIP'}) ) { + $qossettings{'VALID'} = 'no'; + $message = $Lang::tr{'The source IP address is invalid.'}; + } } } if ( $qossettings{'DIP'} ne '' ) { - unless ( &General::validip($qossettings{'DIP'}) ) { - $qossettings{'VALID'} = 'no'; - $message = $Lang::tr{'The destination IP address is invalid.'}; + if ($qossettings{'QIP'} =~ /^(.*?)\/(.*?)$/){ + if ( &General::validipandmask($qossettings{'DIP'}) ) { + $qossettings{'VALID'} = 'no'; + $message = $Lang::tr{'The destination IP address is invalid.'}; + } + }else{ + if ( &General::validip($qossettings{'DIP'}) ) { + $qossettings{'VALID'} = 'no'; + $message = $Lang::tr{'The destination IP address is invalid.'}; + } } } if ($qossettings{'CLASS'} >= 100 && $qossettings{'CLASS'} < 121) { @@ -1079,10 +1093,10 @@ END print <  $Lang::tr{'source ip'}: - +   $Lang::tr{'destination ip'}: - + $Lang::tr{'qos warning'} @@ -1123,10 +1137,10 @@ END   $Lang::tr{'source ip'}: - +   $Lang::tr{'destination ip'}: - + END -- 2.39.2