summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorInaky Perez-Gonzalez <inaky@linux.intel.com>2009-04-27 21:46:08 (GMT)
committerThomas Graf <tgr@plip.localdomain>2009-05-04 12:56:24 (GMT)
commitef8ba32e0ca7ac7bbbaf87f6fd7b197af18aed25 (patch)
tree52c7b695f82e0f0e9f14940de3a397a49114612a /lib
parent8ee16e6688657886f591f0841cb8e892743ecf2a (diff)
downloadlibnl-ef8ba32e0ca7ac7bbbaf87f6fd7b197af18aed25.zip
libnl-ef8ba32e0ca7ac7bbbaf87f6fd7b197af18aed25.tar.gz
libnl-ef8ba32e0ca7ac7bbbaf87f6fd7b197af18aed25.tar.bz2
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 <inaky@linux.intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/socket.c2
1 files changed, 1 insertions, 1 deletions
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);
}
/**