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=gL3lqnes; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 6560B5A0271 for ; Wed, 02 Apr 2025 05:13:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202502; t=1743563601; bh=eOUlDYJkYGJM0LtN6nhC3oOMrtuSn1N258PqVZfJ3ro=; h=From:To:Cc:Subject:Date:From; b=gL3lqnesdQafjD4M3jKSP/jEUh8GEwrn26LQC7bjD7u+mewfvFun0d10LQGWnroMW qHMPtVXN75O9jfLj4ds+AeHw8gckIfMnCVi9rBN1QKo7pYoudhPz2PDuXy4EOTzLXY kgUHWOhPeowjaAdZUysoiJJWvTzHNKf0JsdoDl8+/uUbqov2uzeBjBpgWQKQfMmjPJ JBkbH7o9d/IcAFGRRPFKeiV8ScIR3ZwFkyTLtG9NtJrw3VwORExzB/r2SYRp8WSMMD v2gQQJ8/p5TnTKOMWGi+kKe55QfUnyLX7XiBnQy0MOwitcBIKBMkarrYGmDrC+qFOi 1BLfbvnp0d60g== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4ZS91F5QGYz4x0L; Wed, 2 Apr 2025 14:13:21 +1100 (AEDT) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH 0/4] RFC: bind() migrated connections in repair mode Date: Wed, 2 Apr 2025 14:13:15 +1100 Message-ID: <20250402031319.3722260-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.49.0 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: OS6MJXL4JTWS3O5QFKWLWOBSPEBFHPRM X-Message-ID-Hash: OS6MJXL4JTWS3O5QFKWLWOBSPEBFHPRM 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: Downstream testing recently discovered that inbound connections can't be migrated properly, because the new socket gets an address conflict with its corresponding listening socket. It turns out this can be avoided by delaying bind() until after we're already in repair mode. Patch 4/4 is the actual fix here. Patch 3/4 adds a test program checking the behaviour to doc/platform-requirements. Patches 1 & 2 fix minor problems I spotted in doc/platform-requirements writing 3/4. Only 4/4 will need to be backported. David Gibson (4): platform requirements: Fix clang-tidy warning platform requirements: Add attributes to die() function platform requirements: Add test for address conflicts with TCP_REPAIR migrate, tcp: bind() migrated sockets in repair mode doc/platform-requirements/.gitignore | 1 + doc/platform-requirements/Makefile | 4 +- doc/platform-requirements/common.h | 1 + doc/platform-requirements/listen-vs-repair.c | 128 ++++++++++++++++++ .../reuseaddr-priority.c | 6 +- tcp.c | 38 ++++-- 6 files changed, 162 insertions(+), 16 deletions(-) create mode 100644 doc/platform-requirements/listen-vs-repair.c -- 2.49.0