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=OxPI+/cs; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 278DC5A0619 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=0fEoG/axochlr/ct0lW6Yw+rJKUw1Ge4u8KHxZKX7kE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OxPI+/csXx9JdQR0tO1x+G/0d9dWpDnJvwGZ7cT5Ns7Zl5nsIbInQr+f/ThSqR0BY 7rPMQldRacrvRtnJD4EM7LEwIqiR29OJLptc4FwIo9Fw+59p3cTrqJGvt0fErPvU2q rK4RtxoiXsd/YSJC7THDMjL3sbgkjwjSpVhivhAKX6EZXumjqq4cgKCzfvVR8wBeKF rn710iTYQgAUP3usKhI1a0fAA27b2BNlJU21aQ0TqEKe5SYMnp0YRRt7c8Tk2jLM+M zy7bLMQf7zptDLekMAgVSdEhrrmGc8hZUKQfH1nMsUmdOeDUD4UuWzf46nqLpWAr4J XrHPAZkjDdgVA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4dHhmm5j6Bz4wH9; Fri, 28 Nov 2025 16:34:00 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH 1/3] util: Correct error message on SO_BINDTODEVICE failure Date: Fri, 28 Nov 2025 16:33:56 +1100 Message-ID: <20251128053358.1576513-2-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251128053358.1576513-1-david@gibson.dropbear.id.au> References: <20251128053358.1576513-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: G3WRMDKN2RESJ7RXKG6RIQENU5XUTZ7V X-Message-ID-Hash: G3WRMDKN2RESJ7RXKG6RIQENU5XUTZ7V 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: The warning message we print of SO_BINDTODEVICE fails is incorrect: we include EPOLL_TYPE_STR(proto), but the proto variable is not an epoll type so this will generate misleading garbage. This has been wrong ever since 340164445 but the message is rare enough that we never noticed. Correct that, and reword the message a bit for clarity while we're there. Fixes: 340164445341 ("epoll: Generalize epoll_ref to cover things other than sockets") Signed-off-by: David Gibson --- util.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/util.c b/util.c index ab23463b..347f34f5 100644 --- a/util.c +++ b/util.c @@ -126,9 +126,10 @@ int sock_l4_sa(const struct ctx *c, enum epoll_type type, char str[SOCKADDR_STRLEN]; ret = -errno; - warn("Can't bind %s socket for %s to %s, closing", - EPOLL_TYPE_STR(proto), - sockaddr_ntop(sa, str, sizeof(str)), ifname); + warn("SO_BINDTODEVICE %s failed for %s on %s: %s", + ifname, EPOLL_TYPE_STR(type), + sockaddr_ntop(sa, str, sizeof(str)), + strerror_(-ret)); close(fd); return ret; } -- 2.51.1