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=202410 header.b=k4APjggR; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 833F05A061A for ; Mon, 18 Nov 2024 03:33:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202410; t=1731897220; bh=QDpjJf56aFjBdvfaA0Nsy7Mlw87MZekFdX3QYadfz8w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=k4APjggRG7mGX0vBBqkHVyq4o59WZOhpA2YLxKosG5sOKhH+lwKA16NJTL6tlWcdS fr4qslCthY8/5zT8cgoJp3R8NluUHuGOBRCUoUH/KT51SoXX1oq4/CEEH/bhLd+vhl YwOU/jKPSToSR4JXcuv657Jmae+7WM4nm7I/SgqqaO703y1ILqFNiI0DKXCOqeSI5r crdNyBEUpjVmgPb3o22S9cIjtgEKLoq/IyKdlg9i4PTiFUVWwLuNrv3yvaK62PKi43 bL2u6ciWyn6sORcV8JPv3Edl7ViknU7GfseT2cGKAW42fYblhZ2rhkWtFR17BSwOa1 n88lkMDIePeRw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4XsBWm3R72z4xfL; Mon, 18 Nov 2024 13:33:40 +1100 (AEDT) Date: Mon, 18 Nov 2024 13:33:05 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v2] ndp: Don't send unsolicited router advertisement if we can't, yet Message-ID: References: <20241115142206.80960-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tOmrk8NNYK497cfF" Content-Disposition: inline In-Reply-To: <20241115142206.80960-1-sbrivio@redhat.com> Message-ID-Hash: A7NBV2PPHN6K4LVXN7HLLRM65ISP4262 X-Message-ID-Hash: A7NBV2PPHN6K4LVXN7HLLRM65ISP4262 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 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: --tOmrk8NNYK497cfF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 15, 2024 at 03:22:06PM +0100, Stefano Brivio wrote: > ndp_timer() is called right away on the first epoll_wait() cycle, > when the communication channel to the guest isn't ready yet: >=20 > 1.0038: NDP: sending unsolicited RA, next in 264s > 1.0038: tap: failed to send 1 frames of 1 >=20 > check that it's up before sending it. This effectively delays the > first gratuitous router advertisement, which is probably a good idea > given that we expect the guest to send a router solicitation right > away. >=20 > Fixes: 6e1e44293ef9 ("ndp: Send unsolicited Router Advertisements") > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson I spotted another buglet in the RA stuff shortly after I sent it: we should suppress calling ndp_timer() at all if c->no_ndp, but I forgot to test for it. > --- > Oops, I sent a previous/wrong version of the patch as v1. >=20 > ndp.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/ndp.c b/ndp.c > index 7ee44b2..1752d64 100644 > --- a/ndp.c > +++ b/ndp.c > @@ -391,7 +391,7 @@ void ndp_timer(const struct ctx *c, const struct time= spec *now) > time_t max_rtr_adv_interval =3D DEFAULT_MAX_RTR_ADV_INTERVAL; > time_t min_rtr_adv_interval, interval; > =20 > - if (c->no_ra || now->tv_sec < next_ra) > + if (c->fd_tap < 0 || c->no_ra || now->tv_sec < next_ra) > return; > =20 > /* We must advertise before the route's lifetime expires */ --=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 --tOmrk8NNYK497cfF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmc6p10ACgkQzQJF27ox 2Gcolw/7BsugfBWR4ia7YcbI6aEh44dfd2gx7GfMBp7REe7JgwVYt+yIb+YO0OPb aqYT44jSY85vM8TeLXxO8wAepxTloI1rMsnf9V9KZ05IXSStzheq+y4ZEr9Ejin7 pc+MfOKSmpowJE9ZUV+FjHISU4epSRl3I3OPzFWap9bMpyHJW89sTwBl2+dWROTA n6/LWFOLdw/mCPA9c+H+N7SH42WebWLpMuUc00P8mpmRd1sWvL7630MuerKzn42o zS8AZFhm3i/hDzZu6SbzsTveq7nLLM8pq5tAPi9WPSIA2S6StdpeJtz0rM1S1RHU 4BKo9C4kNvKHKOQXqUDy2IBOz+Spz7TXw+w+J1j6i6hTFrRoR8W3VY3bvyWfvMH6 r4V/oiN642vA2qMZXvIs7id8Zt45Kgo4QDU9+pxrOWhcGVZU1qtyR+K/vcnhNO01 LnDZMUP/YbEXBQRuPzK+9FbLve7ORPpbNHc7rq09LqQVUhYuw+Gf4lLDIkGLtrSH yJGdCzRLCDkYpT2wB8KTGArpdQ5u/FeyDlK0hF8rOI1H8C3tnLz8K1mykWFG8shV hXi875J4gVHgGE+lblRvg/CaiQmUGbbycmMWxI1GkpOv1wQhQO3o9LM8TCs6YklH U6fBujIUfDTTMEe3GLVwwE7Bb9WmRnelazDe9SI1df3sixO8on8= =FazJ -----END PGP SIGNATURE----- --tOmrk8NNYK497cfF--