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=202510 header.b=kOhIYSfh; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id AD5605A061B for ; Fri, 28 Nov 2025 06:34:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202510; t=1764308040; bh=Xca8eq+Lzhy7xD24cJtg0i0wJXC4dtUZPek669Sx1Hg=; h=From:To:Cc:Subject:Date:From; b=kOhIYSfhnyf9KFrAWvpCpLCS0qnRkJn6+KvEhVxzcmjWV50QmtLMzt4nn/E+zJB3+ 47M0/bNElpmmGWJvB/X0r8+4o79TGQrteBAi4WpOgApFJqFqbNzrLOiNHgsfpzPJEr +Oso1gnL4bX8TjEEkFuzGUYspGf7VNTOZwqlEq4yNBRATkjEWaEaI3O+NK31o06D7h jYsf/5SJtPNwONSZ634VVBhGocxRvHBKUbBElLQ83Ep0gV+MDza+wRhNWqFpvo66z8 rQ6kG+AN4GBgdIgnQCbDzOMh4lditmMvPkrUkGzUYA7gMMda5m0m3bY9+8gLPQeGdS Gb56Y/d4hwJVw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4dHhmm5Sczz4w9w; Fri, 28 Nov 2025 16:34:00 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH 0/3] More graceful handling of kernels without SO_BINDTODEVICE Date: Fri, 28 Nov 2025 16:33:55 +1100 Message-ID: <20251128053358.1576513-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.51.1 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: LB2DX63XW2UH3NWRSCWBWCHKYAW4V6ZT X-Message-ID-Hash: LB2DX63XW2UH3NWRSCWBWCHKYAW4V6ZT 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: Kernels before v5.7 don't allow unprivileged processes to use the SO_BINDTODEVICE socket option, which is how we implement per-device listening (e.g. "-t ""%eth0/80"). Currently we detect this error quite late, and don't produce a particularly helpful error message. Improve error messages in this case by explicitly probing for support of the option early. More importantly this will allow me to implement fallback handling for older kernels in upcoming socket binding cleanups. Note: this series applies directly on the current main branch, I'm going to rebase my socket binding series on top of this, instead of the other way around. David Gibson (3): util: Correct error message on SO_BINDTODEVICE failure util: Extend sock_probe_mem() to sock_probe_features() conf: More useful errors for kernels without SO_BINDTODEVICE conf.c | 6 ++++++ passt.c | 2 +- passt.h | 1 + util.c | 26 +++++++++++++++++++++----- util.h | 2 +- 5 files changed, 30 insertions(+), 7 deletions(-) -- 2.51.1