From 26a0e4d6ee17fa174a401d8e8d9a4c189f11f258 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Mon, 27 Feb 2023 03:30:01 +0100 Subject: Fix definitions of SOCKET_MAX, TCP_MAX_CONNS ...and, given that I keep getting this wrong, add a convenience macro, MAX_FROM_BITS(). Signed-off-by: Stefano Brivio Reviewed-by: David Gibson --- tcp_conn.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tcp_conn.h') diff --git a/tcp_conn.h b/tcp_conn.h index a499f34..c22632b 100644 --- a/tcp_conn.h +++ b/tcp_conn.h @@ -54,7 +54,7 @@ struct tcp_tap_conn { #define TCP_RETRANS_BITS 3 unsigned int retrans :TCP_RETRANS_BITS; -#define TCP_MAX_RETRANS ((1U << TCP_RETRANS_BITS) - 1) +#define TCP_MAX_RETRANS MAX_FROM_BITS(TCP_RETRANS_BITS) #define TCP_WS_BITS 4 /* RFC 7323 */ #define TCP_WS_MAX 14 -- cgit v1.2.3