diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-05-22 17:39:36 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-05-22 17:39:36 -0400 |
commit | e425fc78045f99725d256956acc7360ed71bfaa5 (patch) | |
tree | 99ae8b3c82aa3f5641f264cd7a4b84f90152c827 /src/or/main.c | |
parent | 1a73e178011d24ad2ef252dab7256d7c4fa94a64 (diff) | |
download | tor-e425fc78045f99725d256956acc7360ed71bfaa5.tar.gz tor-e425fc78045f99725d256956acc7360ed71bfaa5.zip |
sandbox: revamp sandbox_getaddrinfo cacheing
The old cache had problems:
* It needed to be manually preloaded. (It didn't remember any
address you didn't tell it to remember)
* It was AF_INET only.
* It looked at its cache even if the sandbox wasn't turned on.
* It couldn't remember errors.
* It had some memory management problems. (You can't use memcpy
to copy an addrinfo safely; it has pointers in.)
This patch fixes those issues, and moves to a hash table.
Fixes bug 11970; bugfix on 0.2.5.1-alpha.
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/or/main.c b/src/or/main.c index 1168f43c9d..f665f87b1e 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -2543,6 +2543,7 @@ tor_free_all(int postfork) microdesc_free_all(); ext_orport_free_all(); control_free_all(); + sandbox_free_getaddrinfo_cache(); if (!postfork) { config_free_all(); or_state_free_all(); |