]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - html/cgi-bin/tor.cgi
tor.cgi: Burst bandwidth may never be less than rate.
[people/teissler/ipfire-2.x.git] / 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);