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=DYhfQ3sY; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id BF2865A026F for ; Wed, 24 Sep 2025 05:34:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202508; t=1758684866; bh=tAkgXOMtRN1K5lc8B838hMcIgc5c+kC1dNMGumizD0E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DYhfQ3sYW0Iu9iiAbed8AdnSQ4ysy2ViAhH7u8kJRfi0GZGvrw5LRtfIs/fmmU9NL KhNas/Mii5p7Dbrc3zxBTT0wp+IdDs1LKL4PAWy/e2y5wBziBHSCog83mwvW9EdHIs Kbk6WAR9LIYvtFciYx/e7uWbnaI6B3N6d3DNe2fY+bfVy3cwLXS9v7eZWFi69UXvxd lQ8FXceIzfVA6eEfnlAiHwxkyyp28LT9Xig5bjqpWs4yCkOaTVUQQl+UbOZWGlUlMm 9WBmhbdW3nmtByBw3HmdRmCuZUSOXazZnPTGzAIihubsDGShg1SXuXVgnwFjtzxlsc 2Q003oPLqWxeQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4cWjBp5Nt7z4wCQ; Wed, 24 Sep 2025 13:34:26 +1000 (AEST) Date: Wed, 24 Sep 2025 13:34:24 +1000 From: David Gibson To: Jon Maloy Subject: Re: [PATCH v9 1/9] netlink: add subsciption on changes in NDP/ARP table Message-ID: References: <20250924011330.1168921-1-jmaloy@redhat.com> <20250924011330.1168921-2-jmaloy@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yuOH7vOWyesBd8vD" Content-Disposition: inline In-Reply-To: Message-ID-Hash: C7UNPLJAWWDGMEP33GJDRWKRATJNC67T X-Message-ID-Hash: C7UNPLJAWWDGMEP33GJDRWKRATJNC67T 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: --yuOH7vOWyesBd8vD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 24, 2025 at 12:47:22PM +1000, David Gibson wrote: > On Tue, Sep 23, 2025 at 09:13:22PM -0400, Jon Maloy wrote: [snip] > > + for (; RTA_OK(rta, na); rta =3D RTA_NEXT(rta, na)) { > > + switch (rta->rta_type) { > > + case NDA_DST: > > + dst =3D RTA_DATA(rta); > > + dstlen =3D RTA_PAYLOAD(rta); > > + break; > > + case NDA_LLADDR: > > + lladdr =3D RTA_DATA(rta); > > + lladdr_len =3D RTA_PAYLOAD(rta); > > + break; > > + default: > > + break; > > + } > > + } >=20 > It seems like somewhere there ought to be something specifying the > address type of both DST and LLADDR, but I'm not sure exactly where. > We should check those, just in case some weirdo runs us on a host with > IPX over Token Ring. Looked into this a bit more. The LLADDR type is a property of the link. I don't know if we get an RTM_NEWLINK before RTM_NEWNEIGH on the subscription channel. If so, we can check that and give up if it's not ARPHRD_ETHER. If not, we should probably probe the LLADDR type via our normal netlink socket and only subscribe if it is ARPHRD_ETHER. For the protocol address type, it looks to be in ndm->ndm_family, though rtnetlink(7) doesn't make that very clear. We should check that, not just the address length. --=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 --yuOH7vOWyesBd8vD Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmjTZr8ACgkQzQJF27ox 2Gfcvw//R7gIxa2FHkHtlCqfdnAyUMLbq6FYyk7IjdWZ4miyZa7TPFTU5JsJ0uhq jXalGCWVmapqYgnnX7k8u9+6b2H0hqlj6L8aWz+BmBF3M3PYOS/epNC0Q4iE6bM3 IFLSS+b/SFymKsx6pcqBldD9bQT1vy7QLgb7jVhlgbobw2kvhiIiMUPFD/u8318b 7IwJDwS+ubXRwoe3CCJmgsHNWX3kv09jo04Gw3quQ1Gy2V0iFyE+vIQCo0bB+A0y 5UZXeF7vqz4zslGHkQ7jDynsGAORHTfB/ZwvCliU2R94ozZR42wAPo5EFMApcPAR UZ3HnyYsOhZinBVSFseDa0BtR4RR6yMMalVNMO1+KISgNk2AyU2ajFE3VHpelZVB Qgo0OGJSQvJibGU3OHx8mFOi8siCuMsn7EKb5ahS0sjPwYzEhHEOSR+OpksYrE0+ GfU3V8UYoywyHeU00Yk8jldDbGGFxA7Gh7TTBEyHgTt/s7pZLzVqGZ5j+pRfuQtA OIafL+ZzazXdoRipV64HB8zors6LMZZoPt3yeROmo0nigC0ITlXK9T0WZeLq1TmM iNc7QTBw6BDuyBBQSqJIx8V5IwZEK2y+YL/Gq4O76JOXnMOKjJHp2wW6WtgW4hmL OhXA6K4ZZo+viAASt3uXy8Io+vupmElzw2w4dqshmAF1Glr+Z7Q= =lYyf -----END PGP SIGNATURE----- --yuOH7vOWyesBd8vD--