From f643c698063a6edd7cf658c5a2fb86ebab0a4627 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Sun, 27 Mar 2022 21:56:29 +0200 Subject: [PATCH] tcp: Fix warning by gcc 5.4 on ppc64le about comparison in CONN_OR_NULL() ...we don't really need two extra bits, but it's easier to organise things differently than to silence this. Signed-off-by: Stefano Brivio --- tcp.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tcp.c b/tcp.c index 34c472b..fe46ede 100644 --- a/tcp.c +++ b/tcp.c @@ -398,12 +398,16 @@ * @seq_init_from_tap: Initial sequence number from tap */ struct tcp_conn { - int next_index :TCP_CONN_INDEX_BITS + 1; + int next_index :TCP_CONN_INDEX_BITS + 2; -#define TCP_MSS_BITS 14 - unsigned int tap_mss :TCP_MSS_BITS; -#define MSS_SET(conn, mss) (conn->tap_mss = (mss >> (16 - TCP_MSS_BITS))) -#define MSS_GET(conn) (conn->tap_mss << (16 - TCP_MSS_BITS)) +#define TCP_RETRANS_BITS 3 + unsigned int retrans :TCP_RETRANS_BITS; +#define TCP_MAX_RETRANS ((1U << TCP_RETRANS_BITS) - 1) + +#define TCP_WS_BITS 4 /* RFC 7323 */ +#define TCP_WS_MAX 14 + unsigned int ws_from_tap :TCP_WS_BITS; + unsigned int ws_to_tap :TCP_WS_BITS; int sock :SOCKET_REF_BITS; @@ -438,14 +442,10 @@ struct tcp_conn { unsigned int hash_bucket :TCP_HASH_BUCKET_BITS; -#define TCP_RETRANS_BITS 3 - unsigned int retrans :TCP_RETRANS_BITS; -#define TCP_MAX_RETRANS ((1U << TCP_RETRANS_BITS) - 1) - -#define TCP_WS_BITS 4 /* RFC 7323 */ -#define TCP_WS_MAX 14 - unsigned int ws_from_tap :TCP_WS_BITS; - unsigned int ws_to_tap :TCP_WS_BITS; +#define TCP_MSS_BITS 14 + unsigned int tap_mss :TCP_MSS_BITS; +#define MSS_SET(conn, mss) (conn->tap_mss = (mss >> (16 - TCP_MSS_BITS))) +#define MSS_GET(conn) (conn->tap_mss << (16 - TCP_MSS_BITS)) #define SNDBUF_BITS 24