From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id 5F50A5A027B for ; Fri, 16 Feb 2024 11:43:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708080229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nT05WOUDnEYMMfpgwtaR713q5gX6LdFuxlRVCxtNX9I=; b=b/Ybpae6uv9ryXyvRk1EbSj5uTAiYsFnQxRoZ5+UvuPchXM5ZqaEUqfCezdgt2wwDqhIgR ayJwLB590alknsTcCHqcK0srpm1MjefUs+C+uRJ6mQZcf6hK/zrxtX2BhC6aUlVgi/fbnc v3YrESAqdBuUTP53iqsdqVe4KIpLyEw= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-648-5F2ZOjyMOTukvqrwL2x3tg-1; Fri, 16 Feb 2024 05:43:48 -0500 X-MC-Unique: 5F2ZOjyMOTukvqrwL2x3tg-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a3d4881bcf5so126472166b.1 for ; Fri, 16 Feb 2024 02:43:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708080226; x=1708685026; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=OW3sM6T5nKD+5Nwizx0VarAr5OmjzoGLHNGR8zyKCAI=; b=bFuVC9jIHJNB3dZVUpra4H53xLKsn8zsgnot1W5GG/yE8SoVRMlLYPntZEyf9jayhG NcCGk0xN+jUbn80orpZ8JqWNInBRmYCOqRYyUyKnAZD8M8SXNdO/MNiWGIpnw0dffAst 6WnX/PcaeTNqZVYX9pDM0OaFluJx4+HwYhb67GN3cWvFyhz/DQ0DOfjxLJKD7Op4OZ7x /SknY3MA7twdKDaJ2TksCjToR8NUhJNBHXGwVB0J/ECGa2zzftDTUFPuA6QPg8ATR9wo WZ8him81Ke12o5vRYo9BpqdvsYNWKyQS8U7eJuV8MKzriVEC5MjTAhO3prrhpFOSnSPG e5dg== X-Gm-Message-State: AOJu0YwE1RdtfDyrbS9J1ZBvCFv/Raj9NvJdiYuNW/WbptHeRtyOAirF K5yQmsolMaNxLK7Lw58gX11l8ZJZUoCenVPlLXggj9aB0L3ngfWYzdk+Mprbs0xNi3YItV4yl02 a0ySfv72DuMaLjLgJ9rxf8NobAK9DPvEYzvkiolLN22AQ8C7NAOhYqWikgbMG X-Received: by 2002:a17:906:40d1:b0:a3d:3aee:ab73 with SMTP id a17-20020a17090640d100b00a3d3aeeab73mr3476177ejk.67.1708080226468; Fri, 16 Feb 2024 02:43:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IHllqH7L7pQH833T6HP8uGF7VFJ7zw3nyZIvbsgBMkr7/D2npTlNcClWIMUEvGEAcLwx2Zvzw== X-Received: by 2002:a17:906:40d1:b0:a3d:3aee:ab73 with SMTP id a17-20020a17090640d100b00a3d3aeeab73mr3476163ejk.67.1708080226111; Fri, 16 Feb 2024 02:43:46 -0800 (PST) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id vx1-20020a170907a78100b00a3d8be700ddsm1430743ejc.98.2024.02.16.02.43.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2024 02:43:45 -0800 (PST) Date: Fri, 16 Feb 2024 11:43:04 +0100 From: Stefano Brivio To: Paul Holzinger , David Gibson Subject: Re: [PATCH v2] conf: No routable interface for IPv4 or IPv6 is informational, not a warning Message-ID: <20240216114304.7234a83f@elisabeth> In-Reply-To: References: <20240216050907.689274-1-sbrivio@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.36; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: IJSSQJDEJFZWOTUEXL46BPY5B2EBARCQ X-Message-ID-Hash: IJSSQJDEJFZWOTUEXL46BPY5B2EBARCQ X-MailFrom: sbrivio@redhat.com 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 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: On Fri, 16 Feb 2024 11:23:30 +0100 Paul Holzinger wrote: > Hi Stefano, >=20 > On 16/02/2024 06:09, Stefano Brivio wrote: > > ...Podman users might get confused by the fact that if we can't > > find a default route for a given IP version, we'll report that as a > > warning message and possibly just before actual error messages. > > > > However, a lack of routable interface for IPv4 or IPv6 can be a > > normal circumstance: don't warn about it, just state that as > > informational message, if those are displayed (they're not in > > non-error paths in Podman, for example). =20 >=20 > A bit of topic but what actually is the default log level? It's LOG_INFO. > Looking at=20 > the main function I see: >=20 > if (c.debug) > =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 __setlogmask(LOG_UPTO(LOG_DEBUG)); > =C2=A0=C2=A0 =C2=A0else if (c.quiet) > =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 __setlogmask(LOG_UPTO(LOG_ERR)); ^^^ > =C2=A0=C2=A0 =C2=A0else > =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 __setlogmask(LOG_UPTO(LOG_INFO)); >=20 > So if the default is still log level is info there is no way for podman= =20 > to say show warnings/errors only. That's because the second clause above is wrong, I think. It should be: =09else if (c.quiet) =09=09__setlogmask(LOG_UPTO(LOG_WARN)); because we also say in the man page: -q, --quiet Don't print informational messages. but nowhere it's written that we'll also hide warnings with it. > We can use --quiet but I think the=20 > warnings should be displayed to end users as well. > So my next request would be to one of the following: > a) change the default level to warn but then there no way show info=20 > unless debug is set (or add a new flag for info) I think LOG_INFO should really be the default, if you use passt or pasta stand-alone that's very helpful. > b) add a flag to select warning level ...which is however what --quiet is supposed to do. > c) log info to stdout and warn/err to stderr then podman could just show= =20 > stderr and hide stdout ...which doesn't fit the meaning of standard output though: pasta has no functional terminal output. I would just fix --quiet if that suits Podman as well. > > While at it, make it clear that we're disabling IPv4 or IPv6 if > > there's no routable interface for the corresponding IP version. > > > > Reported-by: Paul Holzinger > > Link: https://github.com/containers/podman/pull/21563#issuecomment-1937= 024642 > > Signed-off-by: Stefano Brivio > > --- > > v2: Report that we're disabling IPv4 or IPv6 in the message > > > > conf.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/conf.c b/conf.c > > index 5e15b66..3646700 100644 > > --- a/conf.c > > +++ b/conf.c > > @@ -579,7 +579,7 @@ static unsigned int conf_ip4(unsigned int ifi, > > =09=09ifi =3D nl_get_ext_if(nl_sock, AF_INET); > > =20 > > =09if (!ifi) { > > -=09=09warn("No external routable interface for IPv4"); > > +=09=09info("No routable interface for IPv4: IPv4 is disabled"); > > =09=09return 0; > > =09} > > =20 > > @@ -651,7 +651,7 @@ static unsigned int conf_ip6(unsigned int ifi, > > =09=09ifi =3D nl_get_ext_if(nl_sock, AF_INET6); > > =20 > > =09if (!ifi) { > > -=09=09warn("No external routable interface for IPv6"); > > +=09=09info("No routable interface for IPv6: IPv6 is disabled"); =20 > > The code only looks for a default route, so if one has some custom=20 > internal routes then saying no routable interface found is confusing.=20 > What this should really say is: > No interface with a default route for IPv... Oops, sorry, I just pushed this. I think it's clear enough in the sense that by design passt and pasta need a default route, and if you have a specific route on a given interface, that interface is not "routable" for our purposes. But sure, we can make it more explicit. Building on your suggestion -- would this be okay: "No interface with a default route for IPv[46]: disabling IPv[64]" ? David? --=20 Stefano