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=202502 header.b=A7S9c23S; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id D26985A0622 for ; Thu, 06 Feb 2025 06:50:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202502; t=1738820984; bh=2QeBNs2nWPsjlljgPnObT5ojCe9iDe2mwJGOx9HnmeU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A7S9c23Sb3NUrQu5BXby1zGx5ljUCo7JcVscNwtG7BaNkuW+/ohEdPpDDMr9urxpY L685i/hx3ADSe8nJEroFV53zToliYqWq8V0CC6y5NMUOgEzEG66Kf06uzrC+aePo2M khH+RZYZ5jtG+pQZKcrTQcMyrowfniv3raMB6Oa5WBBHS/FIQmwZjUrL87Uu0xb+XA nTZUEtVkqQYTwMmM9435Ap3+36ldpriM3Ui+/rSpv9/lvA61IUxB4CPvVlXNFiWUdg W2vKCLhboFUV7v3uHkLbRUFFOIBRXA6vbhy2KZEsGqIYMGCBd5W62cq3fNQI/LdrWn kdimv4J/zwqJQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4YpR544Gq9z4x2J; Thu, 6 Feb 2025 16:49:44 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v10 09/10] fixup: Reset SO_PEEK_OFF value after incoming migration Date: Thu, 6 Feb 2025 16:49:50 +1100 Message-ID: <20250206054951.1041610-10-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250206054951.1041610-1-david@gibson.dropbear.id.au> References: <20250206054951.1041610-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: SZADYRTLEBD544OG33DMQKHJHW3JYIY6 X-Message-ID-Hash: SZADYRTLEBD544OG33DMQKHJHW3JYIY6 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: David Gibson 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: TCP code needs to do different things depending on whether SO_PEEK_OFF is enabled on the socket, and it assumes it is already set if it is supported. However, we didn't re-enable it on sockets created for an incoming migration. Signed-off-by: David Gibson --- tcp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tcp.c b/tcp.c index 885ba3af..5b389ef8 100644 --- a/tcp.c +++ b/tcp.c @@ -3076,6 +3076,7 @@ int tcp_flow_migrate_target_ext(struct ctx *c, union flow *flow, int fd) { struct tcp_tap_conn *conn = &flow->tcp; struct tcp_tap_transfer_ext t; + uint32_t peek_offset; int s = conn->sock; if (read_all_buf(fd, &t, sizeof(t))) @@ -3104,5 +3105,9 @@ int tcp_flow_migrate_target_ext(struct ctx *c, union flow *flow, int fd) tcp_flow_repair_off(c, conn); + peek_offset = conn->seq_to_tap - conn->seq_ack_from_tap; + if (tcp_set_peek_offset(conn->sock, peek_offset)) + tcp_rst(c, conn); + return 0; } -- 2.48.1