Commit 3806b60d authored by Matúš Olekšák's avatar Matúš Olekšák Committed by Jan Kiszka

Fixed long size in UDP port bitmap index

There is issue when you are using 64bit Linux and increasing RT_UDP_SOCKETS
above 64, because on 64 bit Linux long has 64 bits instead of hardcoded 32
bits. This patch fixes the situation on both 32 and 64 bit OS.
Signed-off-by: default avatarMatúš Olekšák <oleksak.matus@gmail.com>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent 9287a691
......@@ -301,7 +301,7 @@ int rt_udp_socket(struct rtdm_fd *fd)
break;
index = ffz(port_bitmap[i]);
set_bit(index, &port_bitmap[i]);
index += i * 32;
index += i * BITS_PER_LONG;
sock->prot.inet.reg_index = index;
sock->prot.inet.sport = index + auto_port_start;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment