diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2022-03-27 21:56:29 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-03-29 15:35:38 +0200 |
commit | f643c698063a6edd7cf658c5a2fb86ebab0a4627 (patch) | |
tree | e19638e69595475fcb894fa3708902ddcbad1530 /tcp.c | |
parent | 052424d7f5edb687adc0b9fe4cbc664f9f08d130 (diff) | |
download | passt-f643c698063a6edd7cf658c5a2fb86ebab0a4627.tar passt-f643c698063a6edd7cf658c5a2fb86ebab0a4627.tar.gz passt-f643c698063a6edd7cf658c5a2fb86ebab0a4627.tar.bz2 passt-f643c698063a6edd7cf658c5a2fb86ebab0a4627.tar.lz passt-f643c698063a6edd7cf658c5a2fb86ebab0a4627.tar.xz passt-f643c698063a6edd7cf658c5a2fb86ebab0a4627.tar.zst passt-f643c698063a6edd7cf658c5a2fb86ebab0a4627.zip |
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>
Diffstat (limited to 'tcp.c')
-rw-r--r-- | tcp.c | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -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 |