tor.cgi: Burst bandwidth may never be less than rate.
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 2 Aug 2013 08:57:01 +0000 (10:57 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 2 Aug 2013 08:57:01 +0000 (10:57 +0200)
html/cgi-bin/tor.cgi

index dca5fda143c2e596329cfc8300166b74e991aaa5..0c5477fd60fa7040046b6d0e19df20627ecf37fd 100644 (file)
@@ -116,6 +116,14 @@ if ($settings{'ACTION'} eq $Lang::tr{'save'}) {
                }
        }
 
+       # Burst bandwidth must be less or equal to bandwidth rate.
+       if ($settings{'TOR_RELAY_BANDWIDTH_RATE'} == 0) {
+               $settings{'TOR_RELAY_BANDWIDTH_BURST'} = 0;
+
+       } elsif ($settings{'TOR_RELAY_BANDWIDTH_BURST'} < $settings{'TOR_RELAY_BANDWIDTH_RATE'}) {
+               $settings{'TOR_RELAY_BANDWIDTH_BURST'} = $settings{'TOR_RELAY_BANDWIDTH_RATE'};
+       }
+
        if ($errormessage eq '') {
                # Write configuration settings to file.
                &General::writehash("${General::swroot}/tor/settings", \%settings);