From: Inaky Perez-Gonzalez Date: Mon, 27 Apr 2009 21:46:08 +0000 (-0700) Subject: release_local_port: properly compute the bitmap position X-Git-Tag: libnl2_0~37 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ef8ba32e0ca7ac7bbbaf87f6fd7b197af18aed25;p=thirdparty%2Flibnl.git release_local_port: properly compute the bitmap position 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 --- diff --git a/lib/socket.c b/lib/socket.c index d1874f0..8083bbb 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -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); } /**