diff options
author | rl1987 <rl1987@sdf.lonestar.org> | 2018-10-03 15:45:48 +0300 |
---|---|---|
committer | rl1987 <rl1987@sdf.lonestar.org> | 2018-10-03 15:51:59 +0300 |
commit | 9d886185c1783cb16a4bc94cf12f78481d5b985d (patch) | |
tree | 7f6ae06ac37af43c91c7d90fd9b3da84f00ca329 /src/core | |
parent | 2b146bdb9af55931aa7cbabc6009d0f66142a0d8 (diff) | |
download | tor-9d886185c1783cb16a4bc94cf12f78481d5b985d.tar.gz tor-9d886185c1783cb16a4bc94cf12f78481d5b985d.zip |
Make sure we're removing conn from old_conns *once*
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/mainloop/connection.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c index 5ef140b6b3..ef8c60a3da 100644 --- a/src/core/mainloop/connection.c +++ b/src/core/mainloop/connection.c @@ -2762,6 +2762,11 @@ retry_listener_ports(smartlist_t *old_conns, const port_cfg_t *found_port = NULL; /* Okay, so this is a listener. Is it configured? */ + /* That is, is it either: 1) exact match - address and port + * pair match exactly between old listener and new port; or 2) + * wildcard match - port matches exactly, but *one* of the + * addresses is wildcard (0.0.0.0 or ::)? + */ SMARTLIST_FOREACH_BEGIN(launch, const port_cfg_t *, wanted) { if (conn->type != wanted->type) continue; @@ -2805,6 +2810,7 @@ retry_listener_ports(smartlist_t *old_conns, SMARTLIST_DEL_CURRENT(launch, wanted); SMARTLIST_DEL_CURRENT(old_conns, conn); + break; } #endif } |