if ($qossettings{'DOLEVEL7'} eq $Lang::tr{'save'})
{
if ( $qossettings{'QIP'} ne '' ) {
- 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 ((!&General::validipandmask($qossettings{'QIP'})) && (!&General::validip($qossettings{'QIP'}))) {
+ $qossettings{'VALID'} = 'no';
+ $message = $Lang::tr{'The source IP address is invalid.'};
}
}
if ( $qossettings{'DIP'} ne '' ) {
- 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 ((!&General::validipandmask($qossettings{'DIP'})) && (!&General::validip($qossettings{'DIP'}))) {
+ $qossettings{'VALID'} = 'no';
+ $message = $Lang::tr{'The destination IP address is invalid.'};
}
}
if ($qossettings{'CLASS'} >= 100 && $qossettings{'CLASS'} < 121) {
if ($qossettings{'DOPORT'} eq $Lang::tr{'save'})
{
if ( $qossettings{'QIP'} ne '' ) {
- unless ( &General::validip($qossettings{'QIP'}) ) {
+ if ((!&General::validipandmask($qossettings{'QIP'})) && (!&General::validip($qossettings{'QIP'}))) {
$qossettings{'VALID'} = 'no';
- $message = "$Lang::tr{'The source IP address is invalid.'}";
+ $message = $Lang::tr{'The source IP address is invalid.'};
}
}
if ( $qossettings{'DIP'} ne '' ) {
- unless ( &General::validip($qossettings{'DIP'}) ) {
+ if ((!&General::validipandmask($qossettings{'DIP'})) && (!&General::validip($qossettings{'DIP'}))) {
$qossettings{'VALID'} = 'no';
- $message = "$Lang::tr{'The destination IP address is invalid.'}";
+ $message = $Lang::tr{'The destination IP address is invalid.'};
}
}
if ($qossettings{'CLASS'} >= 100 && $qossettings{'CLASS'} < 121) {
$qossettings{'ENABLED'} = 'on';
&General::writehash("${General::swroot}/qos/settings", \%qossettings);
system("/usr/local/bin/qosctrl generate >/dev/null 2>&1");
- system("/usr/bin/touch /var/ipfire/qos/enable");
system("/usr/local/bin/qosctrl start >/dev/null 2>&1");
system("logger -t ipfire 'QoS started'");
}
elsif ($qossettings{'ACTION'} eq $Lang::tr{'stop'})
{
- system("/usr/local/bin/qosctrl stop >/dev/null 2>&1");
- unlink "/var/ipfire/qos/bin/qos.sh";
- unlink "/var/ipfire/qos/enable";
- system("logger -t ipfire 'QoS stopped'");
$qossettings{'ENABLED'} = 'off';
&General::writehash("${General::swroot}/qos/settings", \%qossettings);
+ system("/usr/local/bin/qosctrl stop >/dev/null 2>&1");
+ system("/usr/local/bin/qosctrl generate >/dev/null 2>&1");
+ system("logger -t ipfire 'QoS stopped'");
}
elsif ($qossettings{'ACTION'} eq $Lang::tr{'restart'})
{
$qossettings{'ENABLED'} = 'on';
&General::writehash("${General::swroot}/qos/settings", \%qossettings);
system("/usr/local/bin/qosctrl generate >/dev/null 2>&1");
- system("/usr/bin/touch /var/ipfire/qos/enable");
system("/usr/local/bin/qosctrl start >/dev/null 2>&1");
system("logger -t ipfire 'QoS started'");
} else {
<tr><td width='33%' align='right'>$Lang::tr{'guaranteed bandwith'}:
<td width='33%' align='left'><input type='text' size='20' name='MINBWDTH' maxlength='8' required='1' value="$qossettings{'MINBWDTH'}" />
<td width='33%' align='center'>
- <tr><td width='33%' align='right'>$Lang::tr{'max bandwith'}:
+ <tr><td width='33%' align='right'>$Lang::tr{'max bandwith'} <img src='/blob.gif' alt='*' />:
<td width='33%' align='left'><input type='text' size='20' name='MAXBWDTH' maxlength='8' required='1' value="$qossettings{'MAXBWDTH'}" />
<td width='33%' align='center'>
<tr><td width='33%' align='right'>Burst:
<option value='1' $selected{'TOS'}{'1'}>$Lang::tr{'min costs'} (1)</option></select>
<td width='33%' align='center'>
<tr><td width='33%' align='right'>$Lang::tr{'remark'}:
- <td width='66%' colspan='2' align='left'><input type='text' name='REMARK' size='40' maxlength='40' value="$qossettings{'REMARK'}" /> <img alt="" alt='blob' src='/blob.gif' />
- <tr><td width='33%' align='right'>
+ <td width='66%' colspan='2' align='left'><input type='text' name='REMARK' size='40' maxlength='40' value="$qossettings{'REMARK'}" />
+ <tr><td width='33%' align='right'><img src='/blob.gif' alt='*' /> $Lang::tr{'required field'}
<td width='33%' align='left'>
<td width='33%' align='center'><input type='submit' name='DOCLASS' value='$Lang::tr{'save'}' /> <input type='reset' value='$Lang::tr{'reset'}' />
</table></form>