]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - html/cgi-bin/qos.cgi
kernel: update to 4.9.34
[ipfire-2.x.git] / html / cgi-bin / qos.cgi
index dee6f41bd014ee45d17f5a7939908c7fbb3501c1..590ad15bff37e60e45b8fa2b8a34b0763d56da8b 100644 (file)
@@ -251,13 +251,13 @@ END
 if ($qossettings{'DOLEVEL7'} 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.'};
                }
        }
        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.'};
                }
@@ -326,15 +326,15 @@ END
 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) {
@@ -463,18 +463,16 @@ if ($qossettings{'ACTION'} eq $Lang::tr{'start'})
        $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'})
 {
@@ -587,7 +585,6 @@ END
                $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 {
@@ -938,7 +935,7 @@ END
                <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'>&nbsp;
-               <tr><td width='33%' align='right'>$Lang::tr{'max bandwith'}:
+               <tr><td width='33%' align='right'>$Lang::tr{'max bandwith'}&nbsp;<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'>&nbsp;
                <tr><td width='33%' align='right'>Burst:
@@ -960,8 +957,8 @@ print <<END
                                <option value='1' $selected{'TOS'}{'1'}>$Lang::tr{'min costs'} (1)</option></select>
                    <td width='33%' align='center'>&nbsp;
                <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'>&nbsp;
+                   <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='*' />&nbsp;$Lang::tr{'required field'}
                    <td width='33%' align='left'>&nbsp;
                    <td width='33%' align='center'><input type='submit' name='DOCLASS' value='$Lang::tr{'save'}' />&nbsp;<input type='reset' value='$Lang::tr{'reset'}' />
                </table></form>
@@ -1079,10 +1076,10 @@ END
        print <<END
                    </select><td width='33%' align='center'>&nbsp;
                <tr><td width='33%' align='right'>$Lang::tr{'source ip'}:
-                   <td width='33%' align='left'><input type='text' name='QIP' maxlength='15' value='$qossettings{'QIP'}' />
+                   <td width='33%' align='left'><input type='text' name='QIP' maxlength='31' value='$qossettings{'QIP'}' />
                    <td width='33%' align='center'>&nbsp;
                <tr><td width='33%' align='right'>$Lang::tr{'destination ip'}:
-                   <td width='33%' align='left'><input type='text' name='DIP' maxlength='15' value='$qossettings{'DIP'}' />
+                   <td width='33%' align='left'><input type='text' name='DIP' maxlength='31' value='$qossettings{'DIP'}' />
                    <td width='33%' align='center'><input type='hidden' name='CLASS' value='$qossettings{'CLASS'}' /><input type='submit' name='DOLEVEL7' value='$Lang::tr{'save'}' />
                <tr><td colspan="3" align='center'><font color="red"><em>$Lang::tr{'qos warning'}</em></font>
                </table></form>
@@ -1123,10 +1120,10 @@ END
                    <td width='33%' align='left'><input type='text' name='DPORT' maxlength='11' value='$qossettings{'DPORT'}' />
                    <td width='33%' align='center'>&nbsp;
                <tr><td width='33%' align='right'>$Lang::tr{'source ip'}:
-                   <td width='33%' align='left'><input type='text' name='QIP' maxlength='15' value='$qossettings{'QIP'}' />
+                   <td width='33%' align='left'><input type='text' name='QIP' maxlength='31' value='$qossettings{'QIP'}' />
                    <td width='33%' align='center'>&nbsp;
                <tr><td width='33%' align='right'>$Lang::tr{'destination ip'}:
-                   <td width='33%' align='left'><input type='text' name='DIP' maxlength='15' value='$qossettings{'DIP'}' />
+                   <td width='33%' align='left'><input type='text' name='DIP' maxlength='31' value='$qossettings{'DIP'}' />
                    <td width='33%' align='center'><input type='hidden' name='CLASS' value='$qossettings{'CLASS'}' /><input type='submit' name='DOPORT' value='$Lang::tr{'save'}' />
                </table></form>
 END