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=202606 header.b=WS6DBkWK; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 2BD895A0269 for ; Mon, 27 Jul 2026 09:06:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202606; t=1785135966; bh=wdyhHJchcF9PBjz8RI04s+/nH+Ho/7ylKsCzUXiG7rs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WS6DBkWKRPrtvy0LobyUs/uaAe4fA95WCeVya2mtzPtubozSNf4Bfy6Fphr+YupUr 8hPyF/pl0UKDV+BQsF4i+YyogSIQrIypoaqONtSC/V+FEUItDSR7MtmaDHSzxWaM1y 99VVaHskQuzimZFaKSepJSyueoW3QeFgTb8yb01qcpKKUAINHj9m762sMY//ZPcT6o fnSDlDthSSOZht4xAcqUYH0GefmHUtH91Av9krTKM69poy7PvM7SEo1T3KCVHuWZNn E6ZBRs7N3QNcJ8YT5iXuyN+2BQJ6jBrIHCgrnMcWifPIMySjirrOnlRjfdnTTolTB4 SrPzMI7477ByA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4h7qPp5xLgz4w9T; Mon, 27 Jul 2026 17:06:06 +1000 (AEST) Date: Mon, 27 Jul 2026 17:05:51 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH] fwd: Don't log warnings when failing to bind "weak" ports, just debug messages Message-ID: References: <20260727061840.1840487-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="8BZagBnanx6n4DMM" Content-Disposition: inline In-Reply-To: <20260727061840.1840487-1-sbrivio@redhat.com> Message-ID-Hash: P56B2FJIBWVHDDRHCGVM2RN6UMC6IJJU X-Message-ID-Hash: P56B2FJIBWVHDDRHCGVM2RN6UMC6IJJU 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: passt-dev@passt.top, frajo@frajo.fi 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: --8BZagBnanx6n4DMM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 27, 2026 at 08:18:40AM +0200, Stefano Brivio wrote: > When ports are forwarded by exclusion, we might fail to bind all > privileged ports (typically lower than 1024), but that's actually > expected, and we shouldn't log warnings just because of that. >=20 > Now, if those ports are automatically forwarded, and we have a > container binding some low ports, we'll log those warnings messages > every second, which is just unnecessary noise in the system log or > in log files. >=20 > Use LOG_DEBUG as severity for those messages, instead of LOG_WARNING, > so that they are only printed when --debug is given: that should be > convenient enough to investigate things, while avoiding excess noise > during regular operations. >=20 > There might be more sophisticated ways to limit this noise, but this > might be a significant regression in some setups, introduced by recent > changes in port forwarding handling, so I'm going for a somewhat > minimal fix for the moment, which can be improved later on if needed. >=20 > Reported-by: frajo > Link: https://bugs.passt.top/show_bug.cgi?id=3D213 > Fixes: b223bec48213 ("fwd, tcp, udp: Set up listening sockets based on fo= rward table") > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson > --- > fwd.c | 21 +++++++++++++-------- > 1 file changed, 13 insertions(+), 8 deletions(-) >=20 > diff --git a/fwd.c b/fwd.c > index 4ba0af3..5679a3d 100644 > --- a/fwd.c > +++ b/fwd.c > @@ -392,17 +392,22 @@ static int fwd_sync_one(const struct ctx *c, uint8_= t pif, unsigned idx, > fd =3D pif_listen(c, rule->proto, pif, addr, ifname, port, idx); > if (fd < 0) { > char astr[INANY_ADDRSTRLEN]; > + int pri =3D LOG_WARNING; > =20 > - warn("Listen failed for %s %s port %s%s%s/%u: %s", > - pif_name(pif), ipproto_name(rule->proto), > - inany_ntop(addr, astr, sizeof(astr)), > - ifname ? "%" : "", ifname ? ifname : "", > - port, strerror_(-fd)); > + if (rule->flags & FWD_WEAK) > + pri =3D LOG_DEBUG; > =20 > - if (!(rule->flags & FWD_WEAK)) > - return -1; > + logmsg(true, false, pri, > + "Listen failed for %s %s port %s%s%s/%u: %s", > + pif_name(pif), ipproto_name(rule->proto), > + inany_ntop(addr, astr, sizeof(astr)), > + ifname ? "%" : "", ifname ? ifname : "", > + port, strerror_(-fd)); > =20 > - continue; > + if (rule->flags & FWD_WEAK) > + continue; > + > + return -1; > } > =20 > socks[port - rule->first] =3D fd; > --=20 > 2.43.0 >=20 --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --8BZagBnanx6n4DMM Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmpnA0oACgkQzQJF27ox 2GcepA//c5MlCEsqRRBZhleiLHbVrG2JOtuSl3cyJApQx+bHbrBTxebh6xtAeqYJ jn/Sfc9jQA9su8blRv6cZSZxoe46E0qJCt3d9XMt8A/ROFn8tKeGz2i/aqA0XOvA +XOnhnJFciI+yrxw0LqGfAFC/UT5ncpdjcF5ueLPHmW3sUx/CdYiZC9hbN++Jq1u 2GTvmJ0kQ2BNJYsyZnlOo/Dz+Mr/zxgBwB/Si9OsIJYedKlHIz54gHrU5pJidotO zsc+ME2GeHVWRo6lrGixVTJQnduxiQYA39Zn+SOoIM+pvyx+/HwiS/jshOisYZs8 zfzXT9vaE2BR353lydOTolLJv6XVeLtnNFfifrT7OGlj/T+pEtp4LGniNj4kLhb+ /EeVm7AjQgd6yUFhincISfJDaHglEAkW5XEMRIJ0fhM/QEb2EzS15wxvt+SYFyVs 9vmP0SodSiwM6pPscrY5UPOFiHPDRmtn8bYiavwS0ZwkV+nkVT6UBm9Z/bij3oWv oF14vaIt6uCvHXcAtwqz1kbdxjk3b84MEHa9+/VzYot95oHzNdLZSt2RMMwh2/ut p/7PFz6F1GX+4bZaeHsVnJ7iNc94saEFZOECdtDlbGDTAnnWhudZut+JoprBZahp f2+sbpTDVYiiahWWioNrdxYsbzuvdaWR+BUqeWpEKlLqDF9P4Pc= =yPim -----END PGP SIGNATURE----- --8BZagBnanx6n4DMM--