From 98a6f29df3d2f5102da9ea035264c321d9d12969 Mon Sep 17 00:00:00 2001 From: "Ilya A. Evenbach" Date: Mon, 22 Apr 2024 05:39:24 -0700 Subject: [PATCH] Fix ubsan complaint about incorrect left-shift in generate_local_port() n needs to be uint32_t to fit left shift by 22 bits --- lib/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/socket.c b/lib/socket.c index 9b42f679..742cdace 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -84,7 +84,7 @@ static NL_RW_LOCK(port_map_lock); static uint32_t generate_local_port(void) { int i, j, m; - uint16_t n; + uint32_t n; static uint16_t idx_state = 0; uint32_t pid = getpid() & 0x3FFFFF;