diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-03-15 11:19:59 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-03-15 11:19:59 -0400 |
commit | 368825ff4529e78ec5be3f79aacf5a5bdd18ef6a (patch) | |
tree | f61b13f21629d110c6a4b9126b88880f614e632f /src/or/main.c | |
parent | b48f8a8114575793046a8e9d3544d6b2d0a17f82 (diff) | |
download | tor-368825ff4529e78ec5be3f79aacf5a5bdd18ef6a.tar.gz tor-368825ff4529e78ec5be3f79aacf5a5bdd18ef6a.zip |
Sandbox: Don't preseed getaddrinfo(gethostname()) in client mode.
If we're a server with no address configured, resolve_my_hostname
will need this. But not otherwise. And the preseeding itself can
consume a few seconds if like tails we have no resolvers.
Fixes bug 18548.
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/or/main.c b/src/or/main.c index 713816d9b7..f37c23c9f5 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -3312,6 +3312,13 @@ do_dump_config(void) static void init_addrinfo(void) { + if (! server_mode(get_options()) || + (get_options()->Address && strlen(get_options()->Address) > 0)) { + /* We don't need to seed our own hostname, because we won't be calling + * resolve_my_address on it. + */ + return; + } char hname[256]; // host name to sandbox |