From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202508 header.b=T6qxxLz5; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 769D75A0271 for ; Mon, 18 Aug 2025 05:04:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202508; t=1755486257; bh=WD8q61dE4Zewm4ppgeqjZHJO/Emnrgywd7UqsRUdeCE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=T6qxxLz5ebfxBBB1iCxUKijntgk52ORwR+Kx500xga73ue0dYDvdSJOKEEOt0/leE aBYKRKZ4wkuejRm9Slk/fbm34H8vsFOJKgyVf32FMOduF6NAUii+LnVqwk7xKM3/WT Lm5VCTDkK79XUc5+wrVa3QAPTla/wK47n9qLWp3u9sIGthLxWa4NBkgN8p+ZopQJIH KXi89obSKBN+kPn92mo1Y/dh58Y/p77NydFjXNeUHI8kbBqnd0wdHX09xbZr4H94VR txZVEQK9SUe+k4Jfmtn8XTodA8pabF+m6px50m07zLKukZ8RpvPuMBqmToRWkzeYQp Iiw+6f4/1dprQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4c4yH52fBcz4wxh; Mon, 18 Aug 2025 13:04:17 +1000 (AEST) Date: Mon, 18 Aug 2025 12:43:08 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 1/6] tcp: FIN flags have to be retransmitted as well Message-ID: References: <20250815161042.3606244-1-sbrivio@redhat.com> <20250815161042.3606244-2-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ayNjR3XDIoQ1FXvD" Content-Disposition: inline In-Reply-To: <20250815161042.3606244-2-sbrivio@redhat.com> Message-ID-Hash: QKVUMQBBNFB4V6UVM32KLQCOL7AGBM27 X-Message-ID-Hash: QKVUMQBBNFB4V6UVM32KLQCOL7AGBM27 X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top, Jon Maloy , Paul Holzinger X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --ayNjR3XDIoQ1FXvD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 15, 2025 at 06:10:37PM +0200, Stefano Brivio wrote: > If we're retransmitting any data, and we sent a FIN segment to our > peer, regardless of whether it was received, we obviously have to > retransmit it as well, given that it can only come with the last data > segment, or after it. >=20 > Unconditionally clear the internal TAP_FIN_SENT flag whenever we > re-transmit, so that we know we have to send it again, in case. >=20 > Reported-by: Paul Holzinger > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson > --- > tcp.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/tcp.c b/tcp.c > index 957b498..7c1f237 100644 > --- a/tcp.c > +++ b/tcp.c > @@ -1759,6 +1759,7 @@ static int tcp_data_from_tap(const struct ctx *c, s= truct tcp_tap_conn *conn, > "fast re-transmit, ACK: %u, previous sequence: %u", > max_ack_seq, conn->seq_to_tap); > conn->seq_to_tap =3D max_ack_seq; > + conn->events &=3D ~TAP_FIN_SENT; > if (tcp_set_peek_offset(conn, 0)) { > tcp_rst(c, conn); > return -1; > @@ -2286,6 +2287,7 @@ void tcp_timer_handler(const struct ctx *c, union e= poll_ref ref) > flow_dbg(conn, "ACK timeout, retry"); > conn->retrans++; > conn->seq_to_tap =3D conn->seq_ack_from_tap; > + conn->events &=3D ~TAP_FIN_SENT; > if (!conn->wnd_from_tap) > conn->wnd_from_tap =3D 1; /* Zero-window probe */ > if (tcp_set_peek_offset(conn, 0)) { --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --ayNjR3XDIoQ1FXvD Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmiikyoACgkQzQJF27ox 2GejqBAAj8kl6/a4IAc8WJRjZ32QnmM1KVcEktSE15flw1CRQ1pHVyZoQDwXXDUX jDIJWyWOqSwJ7zDOBJtdzKG0vIjfmQIK+akoTemj0a1ruHy8NMqQU3PSSQSWe7H9 BAkjgEZsBGq/o8Rh7XcpJOkQmENYnRD3yasjs9e/LBKXO+cXY6idve43Qh+Vi0Qc vC6RtTxawQ1YtuAwL1OKre0IBMuidYSYntE1qfOyKrIHMREWcIoKSxKeQGHAzkKH 5x9AK9LgkZCGkqc+Z1a8hFe1D1yzFcRW4VZEQ1AWaQKpmCUTsGBQ4gpJF4Ci0yUc Wd8maVpzhxNuLcRwCku4wyoapvrsaQKYCeyuS+u//aQqaltTlZmpd8w/kCDKEx+H 2htk2PuZT00YyLeY1VNcN+Ilgys5hReETkWG/uhUFKScJtyEyI2/wyv6seBNb3AN l4ENzom7iZFFBOi7s3OTGMGV//trd/CxyxaEFdsFvyZdt74HT+4NjKJKo7blYskH Y+/VrlUwsjjwL1dj6Ahf33QG6qhFzqvyaui1SC1NhSAwEU9u7Om2ORbGSBwAZgK1 vpWPy+545Z5xRFXdwH1IB+8zhAwh1n82LjKewAJGsmC7XO5hItcTrSPpw9MuANam 2dJowhgcHYa2I6pNrUws14+aMQ02TJ+2OqQp2O1symLohn6Pbfg= =MtgW -----END PGP SIGNATURE----- --ayNjR3XDIoQ1FXvD--