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=xLXZbOvP; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 4A1F75A0272 for ; Wed, 01 Oct 2025 02:24:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202508; t=1759278286; bh=TuLq1rYdFwqB3+FV86Ats0TtUV89AcRamR0ksuvKB6w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=xLXZbOvPRXKGBSk6y+vm8qTSzpmO7X9OhV58O6i9k2kyQHCDPx8J2CRU4TvLogsRx YY2PriC8Bea9zWOwJarqHIXiS4QbmdjngKVMkSDYYPhoKVcoAcIoeXjhKaH1glXYk1 bqrODORAdW248TLg2clm2kA7Lq+026nyZoODgMzNAKfYap4p2CL0r1m1z6bTAzoX20 zl5ECBTVZ7WiL/dYDsgQP4y5AUPPQkAgcFO8ZQ1ZBzV3cDBmaWoGZr01PPj1SNc//5 OlUuhTlbZhlNCTXxn+nBUyixmm8S8Y9lEN5tDD+tD/f+xHdYmMh/rp0np8WAFLscpT i2mdvb6Z/Nmdg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4cbwfk0Jhmz4wBG; Wed, 1 Oct 2025 10:24:46 +1000 (AEST) Date: Wed, 1 Oct 2025 10:17:34 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v11 5/9] flow: add MAC address of LAN local remote hosts to flow Message-ID: References: <20250927192522.3024554-1-jmaloy@redhat.com> <20250927192522.3024554-6-jmaloy@redhat.com> <20250930232932.4e7a2902@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="WdArNQfB/cRn4u/R" Content-Disposition: inline In-Reply-To: <20250930232932.4e7a2902@elisabeth> Message-ID-Hash: QN2RY5WLIL35QLF7D52EUTN54FPHYWEI X-Message-ID-Hash: QN2RY5WLIL35QLF7D52EUTN54FPHYWEI 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: --WdArNQfB/cRn4u/R Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 30, 2025 at 11:29:32PM +0200, Stefano Brivio wrote: > On Sat, 27 Sep 2025 15:25:18 -0400 > Jon Maloy wrote: >=20 > > When communicating with remote hosts on the local network, some guest > > applications want to see the real MAC address of that host instead > > of PASST/PASTA's own tap address. The flow_common structure is a > > convenient location for storing that address, so we do that in this > > commit. > >=20 > > Note that we don=B4t add actual usage of this address here, that will > > be done in later commits. > >=20 > > Signed-off-by: Jon Maloy > > Reviewed-by: David Gibson > >=20 > > --- > > v3: - Moved the remote host macaddress from struct flowside to > > struct flow_common. I chose to call it 'omac' as suggested > > by David, although in my understanding the correct name would be > > 'emac'. (In general I find the address naming scheme confusing.) > > - Adapted to new signature of function nl_mac_get(), now passing > > it the index of the template interface. > > v4: - Renamed flow_commeon->omac to flow_common->tap_omac to make is > > role in the code clearer > > v5: - Modified the criteria for ARP/NDP table lookup like in the > > previous commits. > > - Removed the PIF_TAP lookup case, as David suggested, and did > > instead give the flow->tap_omac field a value marking it as > > non-initialized. > > - Calling the cache table instead of netlink for ARP/NDP lookup. > > - Unconditionally using the potentially translated IP address > > in the lookup, instead of only if NAT really was applied. > > v6: - Using MAC_ZERO instead of own definitions > > --- > > flow.c | 2 ++ > > flow.h | 2 ++ > > 2 files changed, 4 insertions(+) > >=20 > > diff --git a/flow.c b/flow.c > > index feefda3..510f3c5 100644 > > --- a/flow.c > > +++ b/flow.c > > @@ -449,6 +449,7 @@ struct flowside *flow_target(const struct ctx *c, u= nion flow *flow, > > =20 > > switch (f->pif[INISIDE]) { > > case PIF_TAP: > > + memcpy(f->tap_omac, MAC_ZERO, ETH_ALEN); >=20 > I see in the next patch that this is needed as an invalid value for > f->tap_omac, but MAC_ZERO is actually a valid, usable MAC address. Good point, I'd forgotten about that. > I guess we should use ff:ff:ff:ff:ff:ff, instead, as MAC_ONES, or > MAC_UNSPEC. We already have MAC_BROADCAST. --=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 --WdArNQfB/cRn4u/R Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmjccxkACgkQzQJF27ox 2GfCpw//TBCLxiFl9SUl2TyOlFYhJcFbEub4BKAzzjb2AlBMpUBIoh51+26w8Y7W PT44ZjIX6IsPb6YntyhdCM8gZaNSMrtMoGNzth6B/Fvb7Cs/qebPt0XX9H4D41he pjjrSIPhprjWMAkJQ4aklmXdZrvlmtn/Auggidqy/C5M4/6dLdbBFyw0zsu33jqU 5tTWzcPtqYc6pr40PEiMAD2ZR6V1UTIXAz/LvCgdwFTuvyVu1EYtWkGRV25HM1oo olt9OehS4bmTvHaaNUrE1EdrFlCPsx4JEaJFnyiIl+GYWgPc9/W8JOg9+JOBh8zh 1nfU7VNdF3Fn+ESmVNI5GO7IeDX63GiedkEMKuwB491jv5Gn9MaMM1XdKejRrJ8U 5wj0n3Rq4ho5o2TIYqkhecpCyUYactNgquia+2iqdBduv9OnnviOeYdcHHJYkZpF eU7onJ78Ga8I5YinI8KGSzXzAipm/331sUyOqz38El2HBg+Pry2yGKzZ4HKgjOVT EnxEd310QXZWwRr+auztqLzGWWBt8v/A8ekN2awsnm47maOU6pMyYTu9D3LtUrle 7JoAxCSo8CYI/33qX52sKF2dbHHE01V6k8Mx0ClgYTKR7y66qUSIo6CVhMaBwvZH UVRSGVE2F7t3BqaSJswpG/lrbrMdyhShxjxDpAZDzaNxrPzAq9U= =zp43 -----END PGP SIGNATURE----- --WdArNQfB/cRn4u/R--