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=202508 header.b=orq9Rt70; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 7E0505A0274 for ; Mon, 29 Sep 2025 06:08:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202508; t=1759118915; bh=YzjHLMaZ7iZd5JlNVc2uTq1TeaUtzbmYLeYXL4BEWbQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=orq9Rt70eQLdp0YjQQN3xx/UvMF5t1jycYMTpZo5XLtJRQW/K5LX7DZe2jd3PXBqa bMFWqImPaVY3jjdHI2YmWqffNNhuyTYcb3Pra/wUnAbojXhC0LCSgRmvON8J46XYuR Re/XTQ9nt6zsUWuWU8oCreLNhmIDQLrwEZvoaeDTeVr2D/SfHt7WAQHUXQ82yVO4yR 1dpIOLT/5s5pxWOuoc5KrrtelDEQRkNuj+amOfTF39IbE7hCOyHgYESvr1h4Bgss9N qqC/0TNLVP0mlx1gLuRK96wlhCS3kcSMOuBD/khXC/ZG90uXPd7LH65GfuzbvR0KUW u3EObQD0ewaSg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4cZnjv2BS5z4wDF; Mon, 29 Sep 2025 14:08:35 +1000 (AEST) Date: Mon, 29 Sep 2025 14:08:27 +1000 From: David Gibson To: Jon Maloy Subject: Re: [PATCH v9 9/9] arp/ndp: send gratuitous ARP / unsolicitated NA when MAC cache entry added Message-ID: References: <20250924011330.1168921-1-jmaloy@redhat.com> <20250924011330.1168921-10-jmaloy@redhat.com> <2cf5fd66-a5f5-45b0-8e4d-57ab56bf874c@redhat.com> <1ea1be6e-dc51-4771-8cdc-84acf917d7f6@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="/PMwBfZReefLQBtX" Content-Disposition: inline In-Reply-To: <1ea1be6e-dc51-4771-8cdc-84acf917d7f6@redhat.com> Message-ID-Hash: RSPX57QIT6JGKGURWPCLHDRCVPDDWITV X-Message-ID-Hash: RSPX57QIT6JGKGURWPCLHDRCVPDDWITV 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: sbrivio@redhat.com, dgibson@redhat.com, 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: --/PMwBfZReefLQBtX Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 27, 2025 at 03:32:38PM -0400, Jon Maloy wrote: >=20 >=20 > On 2025-09-26 19:25, Jon Maloy wrote: > >=20 > > On 2025-09-23 23:22, David Gibson wrote: > > > On Tue, Sep 23, 2025 at 09:13:30PM -0400, Jon Maloy wrote: > > > > Gratuitious ARP and unsolicitated NA should be handled with caution > > > > because of the risk of malignant users emitting them to disturb > > > > network communication. > > > >=20 > > [...] > > > > +=A0=A0=A0 req.ah.ar_op =3D htons(ARPOP_REPLY); > > > > +=A0=A0=A0 req.ah.ar_hrd =3D htons(ARPHRD_ETHER); > > > > +=A0=A0=A0 req.ah.ar_pro =3D htons(ETH_P_IP); > > > > +=A0=A0=A0 req.ah.ar_hln =3D ETH_ALEN; > > > > +=A0=A0=A0 req.ah.ar_pln =3D 4; > > > > + > > > > +=A0=A0=A0 /* ARP message */ > > > > +=A0=A0=A0 memcpy(req.am.sha, mac, sizeof(req.am.sha)); > > > > +=A0=A0=A0 memcpy(req.am.sip, &ip, sizeof(req.am.sip)); > > > > +=A0=A0=A0 memcpy(req.am.tha, MAC_BROADCAST, sizeof(req.am.tha)); > > > > +=A0=A0=A0 memcpy(req.am.tip, &ip, sizeof(req.am.tip)); > > >=20 > > > So, I was trying to check if it made sense to use the same IP for both > > > source and target here, and came across > > > =A0=A0=A0=A0 https://www.rfc-editor.org/rfc/rfc5227#section-3 > > >=20 > > > Which suggests we should (counter intuitively) be using ARP requests, > > > not ARP replies for announcements. > >=20 > > I have now read through it, and it seems to come to the conclusion > > that this is not advisable. In principle it should work, if all What "this" refers to here is not clear to me. > > implementations stick to standard, but there might be stacks which are > > not stateless in this regard, i.e., they only accepts ARP replies as a > > response to a sent request. > > In short, I think I will stick to my current approach, since it is > > evidently harmless and is proven to work. > >=20 > > ///jon >=20 > My response above may look confusing. Yes.. and I'm still confused. Without knowing what "this" is above, I'm not clear what "it" or "the other" are below either. > I had actually experimented with both > methods, and had in my mind that it was the "ARP Announcement" > implementation I had posted. > It is now fixed. >=20 > That said, further investigation indicates that the other method is fully > legit, and actually widely used (Windows, Cisco), although not > by Linux. My understanding of that RFC is that it is advising _against_ sending unsolicited ARP replies (as your earlier posted versions did). Instead, it advises sending ARP requests in order to announce a MAC to the networm. The history is confusing because "ARP announcements" and "gratuitous ARP" can and have been used to refer to both variants. Does that match your current understanding? --=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 --/PMwBfZReefLQBtX Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmjaBjoACgkQzQJF27ox 2GfJMw//WcLahPgeP6tSuEPDxvhpd/gme6CJ5StbO4VSdZtiioH8+vDYy/xsLElE muuGYFVG6NKwhrErgbetr9qJJJX7dw/bGn/ndYNv8cValSxa/Jd4ejzahgiXxjg6 BCK5l1d6OUHx6bE2LZ+MCw17j1tIhJ6zSXT+CxZiKQuSWHG7lZdBIICbtrb5+B2y CQkl1kLe1CfKNb5fKdbhdxTeu41Tsvaik6H6RypyxrAvEk9Gv5RUniapGYo4N8G2 STElfqxHsRhw0fsVmykozYTrLLaTSxbXFLD3fOw4I8cre+xIkouBYfKmHb0+IeXR r38EI/R9FImBkdT+47js3dee/2LwMcxTlOZ0DgGdNOyX4K011kIs7bXMeSvaNzdX bRbwdFme5sDSIph1xyPVZtKgwOwEeKKh41LPQwwmtMCq5n2m4VGBtFONWEpuhckm h9BW/prZcIGqLTrGDQdX2bLYTNgU/e27rhj64uYOi0rDfl3TT2hcSzOk/hVe3WDt pYGcEIcmYbBTc5BhQOFbhn9AdwTm2u6I7RRPn8E09pGXOtcERVZUGINwetzZrNc4 xGE+M2YwcoRt99UnOatQTYIqfC/Fs+ls4yyLtg7kMC+Rn6WGWj7vOzTxKTuJKo1p 62ngNCCxeuE6+BFtbT0Jx8NNktCeK2ZMgGDQrG3D54C/5ch+xtA= =qMRg -----END PGP SIGNATURE----- --/PMwBfZReefLQBtX--