public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* [PATCH] tcp: remove useless assignment
@ 2023-11-28 16:54 Laurent Vivier
  2023-11-29  2:34 ` David Gibson
  0 siblings, 1 reply; 3+ messages in thread
From: Laurent Vivier @ 2023-11-28 16:54 UTC (permalink / raw)
  To: passt-dev; +Cc: Laurent Vivier, sbrivio

In tcp_send_flag(), a4826ee04b76 has replaced:

    th->doff = sizeof(*th) / 4;
    th->doff += OPT_MSS_LEN / 4;
    th->doff += (1 + OPT_WS_LEN) / 4;

by

    optlen = OPT_MSS_LEN + 1 + OPT_WS_LEN;
    th->doff = (sizeof(*th) + optlen) / 4;

but forgot to remove the useless "th->doff += (1 + OPT_WS_LEN) / 4;"

Fixes: a4826ee04b76 ("tcp: Defer and coalesce all segments with no data (flags) to handler")
Cc: sbrivio@redhat.com
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
 tcp.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tcp.c b/tcp.c
index 40e3dec1ca2d..bf5f315afcac 100644
--- a/tcp.c
+++ b/tcp.c
@@ -1693,7 +1693,6 @@ static int tcp_send_flag(struct ctx *c, struct tcp_tap_conn *conn, int flags)
 		*(uint16_t *)data = htons(MIN(USHRT_MAX, mss));
 
 		data += OPT_MSS_LEN - 2;
-		th->doff += OPT_MSS_LEN / 4;
 
 		conn->ws_to_tap = MIN(MAX_WS, tinfo.tcpi_snd_wscale);
 
-- 
@@ -1693,7 +1693,6 @@ static int tcp_send_flag(struct ctx *c, struct tcp_tap_conn *conn, int flags)
 		*(uint16_t *)data = htons(MIN(USHRT_MAX, mss));
 
 		data += OPT_MSS_LEN - 2;
-		th->doff += OPT_MSS_LEN / 4;
 
 		conn->ws_to_tap = MIN(MAX_WS, tinfo.tcpi_snd_wscale);
 
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-04  9:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-28 16:54 [PATCH] tcp: remove useless assignment Laurent Vivier
2023-11-29  2:34 ` David Gibson
2023-12-04  9:54   ` Stefano Brivio

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).