diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-10-07 08:08:02 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-10-07 08:08:02 -0400 |
commit | 8505dd5e372a055014b9305171a5b4b707746120 (patch) | |
tree | 2842b86de8797a8335b65c65e2ce5496a186b90d /src/core/mainloop | |
parent | 30c6b42d3447bb8c00eba7fc1c53cb5b2c5ecbc5 (diff) | |
parent | 902944448206d359d3f799ecf8a504bdff493272 (diff) | |
download | tor-8505dd5e372a055014b9305171a5b4b707746120.tar.gz tor-8505dd5e372a055014b9305171a5b4b707746120.zip |
Merge branch 'maint-0.4.3' into maint-0.4.4
Diffstat (limited to 'src/core/mainloop')
-rw-r--r-- | src/core/mainloop/connection.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c index fd5bf879c5..36b2c6ef63 100644 --- a/src/core/mainloop/connection.c +++ b/src/core/mainloop/connection.c @@ -3048,7 +3048,14 @@ retry_all_listeners(smartlist_t *new_conns, int close_all_noncontrol) &skip, &addr_in_use); } - tor_assert(new_conn); + /* There are many reasons why we can't open a new listener port so in case + * we hit those, bail early so tor can stop. */ + if (!new_conn) { + log_warn(LD_NET, "Unable to create listener port: %s:%d", + fmt_addr(&r->new_port->addr), r->new_port->port); + retval = -1; + break; + } smartlist_add(new_conns, new_conn); |