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=Fiw0yHVt; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 8992D5A061A for ; Fri, 03 Oct 2025 07:33:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202508; t=1759469623; bh=8QGOkQWQ7ZZI758zDMV6GLmgQqClQql1jzhYkVV0Mpk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Fiw0yHVtALXGkz5BSs/sW3RPfJq1Xz9lDt+R8AtsuqSJL6B5mpz5TjsuIiJSs6J3Y LvAoZ6hyfDLaRgaUnCHfHepy/HlYF1nePkHvfsWHv9LU3OJKKoQpiFL+CwNE0bMwmV b5tPaoN5lM4tXNagcnu1U0KSHl06k8k5S0ASJgesmgylsyBHPiBbfmWFJ7zka+OM5Z /rdokDXRT+ji7BGOSswHB3W7/KQ0x8wsRNGlfce9WKvqge8JJcu3zwBq+NtB/xUduF /lKvWvOpMG4LgPBgOHPBSbOxxPdFCaiU5YxItxIPI43CnFkD5pe+ZqbiwJkepHk1yv Hotu0YwoLOFWg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4cdHQH6LqWz4wC9; Fri, 3 Oct 2025 15:33:43 +1000 (AEST) Date: Fri, 3 Oct 2025 14:52:59 +1000 From: David Gibson To: Jon Maloy Subject: Re: [PATCH v12 6/9] udp: forward external source MAC address through tap interface Message-ID: References: <20251003003412.588801-1-jmaloy@redhat.com> <20251003003412.588801-7-jmaloy@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="v3ljIOV89SaDx4ka" Content-Disposition: inline In-Reply-To: <20251003003412.588801-7-jmaloy@redhat.com> Message-ID-Hash: LV7NAYIH4WZHIIRYR63CYXMN2UOIW4JJ X-Message-ID-Hash: LV7NAYIH4WZHIIRYR63CYXMN2UOIW4JJ 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: --v3ljIOV89SaDx4ka Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 02, 2025 at 08:34:09PM -0400, Jon Maloy wrote: > We forward the incoming MAC address through the tap interface when > receiving incoming packets from network local hosts. >=20 > This is a part of the solution to bug > https://bugs.passt.top/show_bug.cgi?id=3D120 >=20 > Signed-off-by: Jon Maloy > Reviewed-by: David Gibson [snip] > @@ -801,13 +800,19 @@ static void udp_buf_sock_to_tap(const struct ctx *c= , int s, int n, > flow_sidx_t tosidx) > { > const struct flowside *toside =3D flowside_at_sidx(tosidx); > + struct udp_flow *uflow =3D udp_at_sidx(tosidx); > + uint8_t *omac =3D uflow->f.tap_omac; > int i; > =20 > if ((n =3D udp_sock_recv(c, s, udp_mh_recv, n)) <=3D 0) > return; > =20 > + /* Find if neighbour table has a recorded MAC address */ > + if (MAC_IS_UNDEF(omac)) > + fwd_neigh_mac_get(c, &toside->oaddr, omac); Uh oh. Here you're looking up based on a guest side address, whereas other places are looking up based on a host side address. You need to pick one. > + > for (i =3D 0; i < n; i++) > - udp_tap_prepare(udp_mh_recv, i, toside, false); > + udp_tap_prepare(udp_mh_recv, i, omac, toside, false); > =20 > tap_send_frames(c, &udp_l2_iov[0][0], UDP_NUM_IOVS, n); > } > diff --git a/udp.h b/udp.h > index 8f8531a..dd6e5ad 100644 > --- a/udp.h > +++ b/udp.h > @@ -21,7 +21,7 @@ int udp_sock_init(const struct ctx *c, int ns, const un= ion inany_addr *addr, > const char *ifname, in_port_t port); > int udp_init(struct ctx *c); > void udp_timer(struct ctx *c, const struct timespec *now); > -void udp_update_l2_buf(const unsigned char *eth_d, const unsigned char *= eth_s); > +void udp_update_l2_buf(const unsigned char *eth_d); > =20 > /** > * union udp_listen_epoll_ref - epoll reference for "listening" UDP sock= ets > --=20 > 2.50.1 >=20 --=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 --v3ljIOV89SaDx4ka Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmjfVqoACgkQzQJF27ox 2Gdd/w//RYXeWU2VHsbBJL8OZAlrbyyJXQYr5YDhQ1EbWmu6X+8QiSgNbWjJPWf7 TEhomFbT9bxqv9eD7mHg/o0RydkQqnZhgeVDZcou1oPG5Hs7JwBZG0fg9lH5Wfjn zShXyIYEp3BkE9dkKzxZzZBfd6eyeqhp4a929o6hVFLMXR2c+UiioA4pyV2IuDSE MUpzTgpCcjGV1EO/grF1+FlADb4AtOIq5b0bFbo+IekoLOJl70lV9RQjHR2auUaP KlKiifdobuZ8HvYxCd9eT/X4gjIx9FSbieaacvK9D/vi/yhjQnfPtGwSuamhSi0I VLQOP2Npf3Qc67sD/oUsyJJw7JJHBV3ir2IpXSsdkAmArG4O0Qkmnh3Wu8C2ZNjX Db8qUOm6UXZL/njqMQLVg2wqOctd+dpJBJtXhT2vh3UVfLQCdJtOq7iYYSpyxxL8 s7f1EjfskidruLrvEcj9vW7N+zbBHfzvkpl83C15VqN+QHzd8aSfkwYYJaHlPpmR 8vk9jooSFXFN/Zo7xyJXy3jXicbS2ebeXbElpKNNetck6Er4rkXFLzYKkf9qFZVM l6WniwaViD82sWz6CQQdxDwBtiYS3gcwgPN3vrdd44DNo5jJmTqTMgBYoNGfCH2K uyEQI1SboXk+KoRvS2k3LouvQNetOphdKy9hpYpm9c0sVIIEFIM= =t9mX -----END PGP SIGNATURE----- --v3ljIOV89SaDx4ka--