]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Make sure we're removing conn from old_conns *once*
authorrl1987 <rl1987@sdf.lonestar.org>
Wed, 3 Oct 2018 12:45:48 +0000 (15:45 +0300)
committerrl1987 <rl1987@sdf.lonestar.org>
Wed, 3 Oct 2018 12:51:59 +0000 (15:51 +0300)
src/core/mainloop/connection.c

index 5ef140b6b3f2c3ebf6f900afc60dfbbba83beab3..ef8c60a3da48765a6e983d4c54e051dea0d401c3 100644 (file)
@@ -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
       }