[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/main] Lower maximum value for guard-extreme-restriction-percent to 100.



commit 15ede0435f5d161e34c11770b6a96f0f31b6cf2f
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Thu Oct 14 12:39:05 2021 -0400

    Lower maximum value for guard-extreme-restriction-percent to 100.
    
    Values greater than 100 would have had the same effect as 100, so
    this doesn't actually change Tor's behavior; it just makes the
    intent clearer.  Fixes #40486; see also torspec#66.
---
 changes/bug40486                | 5 +++++
 src/feature/client/entrynodes.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/changes/bug40486 b/changes/bug40486
new file mode 100644
index 0000000000..83315bfb2b
--- /dev/null
+++ b/changes/bug40486
@@ -0,0 +1,5 @@
+  o Code simplification and refactoring:
+    - Lower the official maximum for "guard-extreme-restriction-percent" to
+      100. This has no effect on when the guard code will generate a warning,
+      but it makes the intent of the option clearer.  Fixes bug 40486; bugfix
+      on 0.3.0.1-alpha.
diff --git a/src/feature/client/entrynodes.c b/src/feature/client/entrynodes.c
index 9583a4db71..315bd54674 100644
--- a/src/feature/client/entrynodes.c
+++ b/src/feature/client/entrynodes.c
@@ -559,7 +559,7 @@ get_extreme_restriction_threshold(void)
   int32_t pct = networkstatus_get_param(NULL,
                                         "guard-extreme-restriction-percent",
                                         DFLT_EXTREME_RESTRICTION_PERCENT,
-                                        1, INT32_MAX);
+                                        1, 100);
   return pct / 100.0;
 }
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits