diff options
author | George Kadianakis <desnacked@riseup.net> | 2021-07-12 12:10:43 +0300 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2021-07-12 12:27:25 +0300 |
commit | 5949a70b58918568eca7d64d6881a10a5ec745ff (patch) | |
tree | ae9dda9e32ce252ae5602e9f63c2d03cbcc96428 /src | |
parent | 7f701794e7d8ce5cb4feb0b6fb1d4b00b68e5c5b (diff) | |
download | tor-5949a70b58918568eca7d64d6881a10a5ec745ff.tar.gz tor-5949a70b58918568eca7d64d6881a10a5ec745ff.zip |
Add stricter limits to the number of L2 nodes
Diffstat (limited to 'src')
-rw-r--r-- | src/feature/client/entrynodes.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/feature/client/entrynodes.c b/src/feature/client/entrynodes.c index 33de8a6b10..9583a4db71 100644 --- a/src/feature/client/entrynodes.c +++ b/src/feature/client/entrynodes.c @@ -3990,6 +3990,10 @@ static routerset_t *layer2_routerset = NULL; /** Number of L2 guards */ #define NUMBER_SECOND_GUARDS 4 +/** Make sure that the number of L2 guards is less than the number of + * MAX_SANE_RESTRICTED_NODES */ +CTASSERT(NUMBER_SECOND_GUARDS < 20); + /** Lifetime of L2 guards: * 1 to 12 days, for an average of a week using the max(x,x) distribution */ #define MIN_SECOND_GUARD_LIFETIME (3600*24) @@ -4002,7 +4006,7 @@ get_number_of_layer2_hs_guards(void) return (int) networkstatus_get_param(NULL, "guard-hs-l2-number", NUMBER_SECOND_GUARDS, - 1, INT32_MAX); + 1, 19); } /** Return the minimum lifetime of L2 guards */ |