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=202504 header.b=ezY3KwgE; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 4B8735A0283 for ; Fri, 13 Jun 2025 08:13:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202504; t=1749795217; bh=mSvv4CyMtmvL1ypmmmZy05FSViVGYukfUON98jQM9pk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ezY3KwgEnko18Jr//0mI9eWkBrfqkn3VjhYm7+speIDD4iZGUGUp9x9dOEckS18tm VVIeq8IynLt2aFlUd3KFCGdWfMjAT6E2amhBIB8/f02YmYvPc0fT9ktvHRDha2fDRs vw7Y/FP+IpHHB9rvDgkWXPSbF5/nNiMzE3zpoBowOgvopbWNjqubklRlKOcDOSkhwz wLCZtFRq+DhJkujwDRkoml6FGLD+Uy77Bxer9zLV1TPg8b6duvv+u6W6yUEz4YAKHB GB8t44JadGMepjk68a0BY68w8p6cU8GE1LsZ0e/sKrRb2S37G1M4+5fGLX6JXBNzoz niBzfwe6IZOjg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4bJTc10v6Kz4x07; Fri, 13 Jun 2025 16:13:37 +1000 (AEST) Date: Fri, 13 Jun 2025 16:11:06 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v2 1/8] netlink: Add function to extract mac addresses from arp table Message-ID: References: <20250612042152.695879-1-jmaloy@redhat.com> <20250612042152.695879-2-jmaloy@redhat.com> <20250612171705.0594ffa4@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="bN1LK67TEIznoy3A" Content-Disposition: inline In-Reply-To: <20250612171705.0594ffa4@elisabeth> Message-ID-Hash: STLL6R3XNWEUWAURFIPC2EDDUV5EMSAD X-Message-ID-Hash: STLL6R3XNWEUWAURFIPC2EDDUV5EMSAD 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: Jon Maloy , 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: --bN1LK67TEIznoy3A Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 12, 2025 at 05:17:05PM +0200, Stefano Brivio wrote: > On Thu, 12 Jun 2025 00:21:45 -0400 > Jon Maloy wrote: >=20 > > The solution to bug #120 requires the ability to translate from > > an IP address to its corresponding MAC address in cases where > > those are present in the ARP/NTP table. >=20 > Nit: NDP. >=20 > > We add this feature here. > >=20 > > Signed-off-by: Jon Maloy >=20 > Nit: David's address is david@gibson.dropbear.id.au (in case you need > to Cc: him specifically). Yes, thanks. [snip] > > + if (IN6_IS_ADDR_V4MAPPED(&addr->a6)) { inany_v4() exists for exactly this sort of case. It will both test if the address is a v4 address, and extract it if so, so you shouldn't need to poke into the innards of union inany_addr. > > + ip =3D &addr->v4mapped.a4; > > + alen =3D sizeof(struct in_addr); > > + req.ndm.ndm_family =3D AF_INET; > > + } else { > > + ip =3D &addr->a6; > > + alen =3D sizeof(struct in6_addr); > > + req.ndm.ndm_family =3D AF_INET6; > > + } --=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 --bN1LK67TEIznoy3A Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmhLwO8ACgkQzQJF27ox 2GdurBAAiVWeS8j7JnBLwKTTtnz6o6WdnFPRKkRx1wKHV29X5YAoK6FVyl/ZX5+q dDuVYxjV03fJ2LTjE03TBtPM/wk66d5brmDm5TNH/6JOw3AnH1ohJ/EdYES+gqK9 X2S2wzVPF1i3J5n7WGZAUc4Q6t/eFSNwnZQ81FhmGuQXOZhDJ97HjIiplEka2vnJ XlpH+oN/sLFfty2ELmndZRipJy+rjpTKI82Zw6PCsa1ksIAaGX4MMKlSjfj2n5wD VZS28jTJkuThiuWUt5TtLndsjTFFPt7mHeAPtmY7P5EDimC5/j9a56n+X+EPmZyT AXbZ3AC4fatavIvlmdJ42WWuwD54BwYjewEujQsFNwKIED87AFULP3vr+XQliQLf ek1zcwAInwh7G63D67B7zeCTCOoC34/9gXLPLuhGXQOPbSqFTNle7Uxf0+Ky2s2k LpAqrMeo3TR+y1W6OkIETb7DavLc6XADdnSouFVYQS0lyOQgzIUrBx4CSrPeiaxM cIezm8HUaCtNiqtkiNn4xM4tfn15TLeXT8PVTlbg92byoGebDLD9VftfGfSxT1PQ vgSkK2He1W1PHdrOkDyuQQxE3IUWoTEQmm9/BRMcbCzR5N5+0uzO0dLevjhKZw94 1tLnVijTpfYob7eBQpPpOPQ6TsaSTz/3KEfHCBFQ5N5pkoKP04A= =2Usg -----END PGP SIGNATURE----- --bN1LK67TEIznoy3A--