]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a double-counting bug in addrmap_get_virtual_address
authorNick Mathewson <nickm@torproject.org>
Wed, 5 Jan 2011 21:02:43 +0000 (16:02 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 5 Jan 2011 21:02:43 +0000 (16:02 -0500)
We were decrementing "available" twice for each in-use address we ran
across.  This would make us declare that we ran out of virtual
addresses when the address space was only half full.

changes/bug2328 [new file with mode: 0644]
src/or/connection_edge.c

diff --git a/changes/bug2328 b/changes/bug2328
new file mode 100644 (file)
index 0000000..e5ce492
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes
+    - Fix a bug where we would declare that we had run out of virtual
+      addresses when the address space was only half-exhausted.  Bugfix
+      on 0.1.1.19-rc.
index 9ecdf5c7a92c7c2d856c2c5e65c0bc51f40c4bf0..6c23775315381f877280917d94f962c92442886b 100644 (file)
@@ -1178,7 +1178,7 @@ addressmap_get_virtual_address(int type)
       ++next_virtual_addr;
       --available;
       log_info(LD_CONFIG, "%d addrs available", (int)available);
-      if (! --available) {
+      if (! available) {
         log_warn(LD_CONFIG, "Ran out of virtual addresses!");
         return NULL;
       }