diff --git a/lib/socket.c b/lib/socket.c index 9b42f679..8272abcf 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -129,7 +129,7 @@ static uint32_t generate_local_port(void) nl_write_unlock(&port_map_lock); /* ensure we don't return zero. */ - pid = pid + (n << 22); + pid = pid + ((n&0x3ff) << 22); return pid ? pid : 1024; } }