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=p3My01xZ; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id DE19E5A061A for ; Tue, 02 Dec 2025 05:02:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202510; t=1764648138; bh=xu3ZpvlY5VfsbVc3iYs74UP+NjyB6W4YdnbBL6vYtZk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p3My01xZtf3h/NL9kP+yRIM7fq/4diS/tfojkCYiT3SFZ3emqNUnpHijt47JzZSD6 QvgRwdNpJRUqpFPl9mMdcNY+/q8q4PSE1DApce6t0oWDg1wtxK39JwZPg7Bpfju0EA TzY0hdVm7/ZvjjxjeWeZTUhKPaFmYIkSyjUlZ7HS9ogrB4SbsHuMGpk2Oco5ulAt6Q T1bpFnXyVsq6KutcOyoeshgGif520u8gD2MSEv9LjQ7FmOCcUQ+DeeNDSsivOMe8RX +8HSVJ19449QhT0qjz90eh5VfDb/HLCzNiNwm2h4mlubY5qRbNwU108fDlqneCoJb/ jcxRwizRGxiIg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4dL6Y6090Gz4w1g; Tue, 02 Dec 2025 15:02:18 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v5 01/15] util: Correct error message on SO_BINDTODEVICE failure Date: Tue, 2 Dec 2025 15:02:01 +1100 Message-ID: <20251202040215.2351792-2-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251202040215.2351792-1-david@gibson.dropbear.id.au> References: <20251202040215.2351792-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: H2NM7TQETRRDXDAD5FWYJD5PK2BAAUHY X-Message-ID-Hash: H2NM7TQETRRDXDAD5FWYJD5PK2BAAUHY 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.52.0