]> granicus.if.org Git - libnl/commitdiff
release_local_port: properly compute the bitmap position
authorInaky Perez-Gonzalez <inaky@linux.intel.com>
Mon, 27 Apr 2009 21:46:08 +0000 (14:46 -0700)
committerThomas Graf <tgr@plip.localdomain>
Mon, 4 May 2009 12:56:24 +0000 (14:56 +0200)
Current calculation is always off, not reflecting the right position
in the bitmap, which results in failures due to conflicts (detected at
the kernel level) when trying to open a new handle.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
lib/socket.c

index d1874f00835bfe53c018e203651d1a7918b9af62..8083bbb6816a40516e48a864cc46ebfaac33088e 100644 (file)
@@ -79,7 +79,7 @@ static void release_local_port(uint32_t port)
                return;
        
        nr = port >> 22;
-       used_ports_map[nr / 32] &= ~((nr % 32) + 1);
+       used_ports_map[nr / 32] &= ~(1 << nr % 32);
 }
 
 /**