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 <sbrivio@redhat.com>
This commit is contained in:
Stefano Brivio 2022-03-27 21:56:29 +02:00
parent 052424d7f5
commit f643c69806

26
tcp.c
View file

@ -398,12 +398,16 @@
* @seq_init_from_tap: Initial sequence number from tap * @seq_init_from_tap: Initial sequence number from tap
*/ */
struct tcp_conn { struct tcp_conn {
int next_index :TCP_CONN_INDEX_BITS + 1; int next_index :TCP_CONN_INDEX_BITS + 2;
#define TCP_MSS_BITS 14 #define TCP_RETRANS_BITS 3
unsigned int tap_mss :TCP_MSS_BITS; unsigned int retrans :TCP_RETRANS_BITS;
#define MSS_SET(conn, mss) (conn->tap_mss = (mss >> (16 - TCP_MSS_BITS))) #define TCP_MAX_RETRANS ((1U << TCP_RETRANS_BITS) - 1)
#define MSS_GET(conn) (conn->tap_mss << (16 - TCP_MSS_BITS))
#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; int sock :SOCKET_REF_BITS;
@ -438,14 +442,10 @@ struct tcp_conn {
unsigned int hash_bucket :TCP_HASH_BUCKET_BITS; unsigned int hash_bucket :TCP_HASH_BUCKET_BITS;
#define TCP_RETRANS_BITS 3 #define TCP_MSS_BITS 14
unsigned int retrans :TCP_RETRANS_BITS; unsigned int tap_mss :TCP_MSS_BITS;
#define TCP_MAX_RETRANS ((1U << TCP_RETRANS_BITS) - 1) #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_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 SNDBUF_BITS 24 #define SNDBUF_BITS 24