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=nqeVqbBi; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 768BC5A0276 for ; Fri, 03 Oct 2025 07:33:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202508; t=1759469623; bh=zWw1hZIlR8mExp4bfViIJsus4/6uH8zEk+lLn5za/54=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nqeVqbBibB+rw1rga5BYAjeOjwGwhGLLU/QKHDISsEFQ9cUFIA/1s/Dvz+DAr2tel zJt2q85m4YgciSGMCALUaBJFdFu7wkzkouLms0PhGgwf0EHcUQJtSaBV+PmGnBCVDf jLSZUrhOsEmPvR8PCuIyYaf0vtd2El/CmZalaY63QfYwzsETF3nMU0NKfvUgm31xhN PgrLPpApX5P9D3i45t/XZf1t5M3jgInQj+K/p87nZMmE5sK5e/va1SwWkW7AisIqDC DZpWDO/uX3ASpuAdoKo3enFaes3GzB/QBXFwouzeHktXfjHuL1P+oYAs0D4ZHUQiHb gUkU+JivsYgRQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4cdHQH6XFsz4wCQ; Fri, 3 Oct 2025 15:33:43 +1000 (AEST) Date: Fri, 3 Oct 2025 14:57:28 +1000 From: David Gibson To: Jon Maloy Subject: Re: [PATCH v12 9/9] icmp: let icmp use mac address from flowside structure Message-ID: References: <20251003003412.588801-1-jmaloy@redhat.com> <20251003003412.588801-10-jmaloy@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="g0MqWJdQvoYk0Fsy" Content-Disposition: inline In-Reply-To: <20251003003412.588801-10-jmaloy@redhat.com> Message-ID-Hash: SOCYTN5GKWMA7WR6UXNKTWND7IZUHRQY X-Message-ID-Hash: SOCYTN5GKWMA7WR6UXNKTWND7IZUHRQY 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: --g0MqWJdQvoYk0Fsy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 02, 2025 at 08:34:12PM -0400, Jon Maloy wrote: > Even ICMP needs to be updated to use the external MAC address instead > of just the own tap address when applicable. We do that here. >=20 > Signed-off-by: Jon Maloy > Reviewed-by: David Gibson >=20 > --- > v3: - Adapted to the move of external MAC address from struct flowside > to struct flow_common > v4: - Adapted to name changes in previous commits in this series > v5: - Added conditional lookup in ARP/NDP if the flow's tap_omac is > undefined > v6: - Looking up MAC of ICMP generating node in udp_send_tap_icmp4/6() > when available, instead trusting the contents of flow->tap_omac. > v12: - Using MAC_IS_UNDEF() instead of MAC_IS_ZERO() > - Comment update after feedback from Stefano > --- > icmp.c | 8 ++++++-- > ndp.c | 2 +- > tap.c | 10 ++++++---- > tap.h | 4 ++-- > udp.c | 12 ++++++++++-- > 5 files changed, 25 insertions(+), 11 deletions(-) >=20 > diff --git a/icmp.c b/icmp.c > index 6dffafb..93b394a 100644 > --- a/icmp.c > +++ b/icmp.c > @@ -125,17 +125,21 @@ void icmp_sock_handler(const struct ctx *c, union e= poll_ref ref) > flow_dbg(pingf, "echo reply to tap, ID: %"PRIu16", seq: %"PRIu16, > ini->eport, seq); > =20 > + /* Find if neighbour table has a recorded MAC address */ > + if (MAC_IS_UNDEF(pingf->f.tap_omac)) > + fwd_neigh_mac_get(c, &ini->oaddr, pingf->f.tap_omac); Again a lookup by guest address. Actually looking at these later patches, having the table stored in terms of guest address probably makes more sense than my earlier suggestions. That means the NAT needs to move where you populate the table from host updates. --=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 --g0MqWJdQvoYk0Fsy Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmjfV7gACgkQzQJF27ox 2GfKABAAhTAlpNY8jBRVsGi+XqNazBsz4W1fDRron/YAo8ecPzU0X0K2+idVyLiV veI8OA80hCIxJlkDm8jFZuoFeDzaVUB1MLcl3Q3VPnwZw/jpvL6TiSo1xFG89TgQ 5tP0EEHZxHHeOVfofjjYwxcHsDphAMP22pa2Whtddqi5cr+77M0KG2Z+f4NZSmPQ mxaHKXxfWx7MpxI8iZuK6C+/pU4aXDLGL/5Utzhs73gYJLucDuC3CZeYPPhM49mA 4lvRwh0F1rZIJ7Gqj6dbbwUCAVWtk4sJYqYhQXCwmFMCUQnt6QuhuGdwFKpuJu/V zvVl2fjQMEpKHdK0GMiw5xEZnoMmGw4UkOPYIMTQXmf6H0Hl8iYGezn53J+1Tpfw 5zgiyubFuAgsho0I6cOqPCtSkL2+2QjvdPF4KD6kD47iDtt2YsCUHFGunCyAssQ1 Rxn9oSm7honeVykZnHQVPQoJTg+GhUoL0+qwMrh51VgAjQlw9k8uP7y3cDn4EesE /xyRS4W1KRU1Oe/HBuUj6tNxT1ODWECc6dmW03EvyxrBZkwcBZ+yHDnxdeBuKGI9 1j1MUXIB43hisOnOSmC3J2IH51pzC7HPLAMsm82ZnQOxzqsja7G2/83ov8JKXIao +jAHakMK3NXlnWZxXRmIATrVOFShyABhTPF+BHj8y4XPNDj9iT4= =lH8h -----END PGP SIGNATURE----- --g0MqWJdQvoYk0Fsy--