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=202510 header.b=acx4H6QV; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 060975A0619 for ; Mon, 13 Oct 2025 01:42:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202510; t=1760312544; bh=dYqX08sSV5/5180r7O1hrj5REqNbCgQ1KUmapKnuunw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=acx4H6QVJo8Os30ZFVTFnEVdH72JI8zeR8Nnz6GZVLW8+So/SGvd6b1r0VBEs0xu3 WAziIutR75YCX+PLN7oBFmqRri3WFT+T4G/wctijeEGnlCDeijIFW0N1wTczdKk8J8 NcgFsjbgfoKwegBnHqPGfgdYwekeTc6RY13B7c6c9YLlxL6l/CSnL87pxFWH/8BTwD bS1RIh2PLO45mx1LuvT5yHyp0JZI8DdmO8xb9luMNJIggmkeJnWqnZ8m85QaJaOJ2t tucXFXf/C0DgqVNpev+C3iNwjcv0hBsMumWv3kRFo0us+RUuUYPO8MGDsoB4g6HyJC SjYCbRXKwTVsg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4clH8J3dZGz4vyd; Mon, 13 Oct 2025 10:42:24 +1100 (AEDT) Date: Mon, 13 Oct 2025 10:34:20 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v11 1/4] tap: break out building of udp header from tap_udp4_send function Message-ID: References: <20250306180006.1921583-1-jmaloy@redhat.com> <20250306180006.1921583-2-jmaloy@redhat.com> <20251010104013.171af1f7@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="DgVsMDQ1VLMzsPv4" Content-Disposition: inline In-Reply-To: <20251010104013.171af1f7@elisabeth> Message-ID-Hash: V2BK3MQTDBAKDGJRXSMSV37HXYVRFH5I X-Message-ID-Hash: V2BK3MQTDBAKDGJRXSMSV37HXYVRFH5I 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 , 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: --DgVsMDQ1VLMzsPv4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 10, 2025 at 10:40:13AM +0200, Stefano Brivio wrote: > On Thu, 6 Mar 2025 13:00:03 -0500 > Jon Maloy wrote: >=20 > > We will need to build the UDP header at other locations than in function > > tap_udp4_send(), so we break that part out to a separate function. > >=20 > > Reviewed-by: David Gibson > > Signed-off-by: Jon Maloy > > --- > > v2: Fix to satisfy coverity. After feedback from S. Brivio > > --- > > tap.c | 34 +++++++++++++++++++++++++++------- > > tap.h | 5 +++++ > > 2 files changed, 32 insertions(+), 7 deletions(-) > >=20 > > diff --git a/tap.c b/tap.c > > index 44b0fc0..16e3761 100644 > > --- a/tap.c > > +++ b/tap.c > > @@ -163,7 +163,7 @@ static void *tap_push_ip4h(struct iphdr *ip4h, stru= ct in_addr src, > > } > > =20 > > /** > > - * tap_udp4_send() - Send UDP over IPv4 packet > > + * tap_push_uh4() - Build UDPv4 header with checksum > > * @c: Execution context > > * @src: IPv4 source address > > * @sport: UDP source port > > @@ -171,16 +171,14 @@ static void *tap_push_ip4h(struct iphdr *ip4h, st= ruct in_addr src, > > * @dport: UDP destination port > > * @in: UDP payload contents (not including UDP header) > > * @dlen: UDP payload length (not including UDP header) > > + * > > + * Return: pointer at which to write the packet's payload > > */ > > -void tap_udp4_send(const struct ctx *c, struct in_addr src, in_port_t = sport, > > +void *tap_push_uh4(struct udphdr *uh, struct in_addr src, in_port_t sp= ort, >=20 > This patch didn't update the function comment, so it now takes a 'uh' > parameter which is not obvious at all. At a first glance, one might say > it's an "input" header. >=20 > Please fix this. Jon, I'll take care of this - needed a quick warm up exercise :). --=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 --DgVsMDQ1VLMzsPv4 Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmjsOvsACgkQzQJF27ox 2GcMrA//VvNM1YzTpbcGrqnwgZnkvHE+BVbrTVi8wE+j/mGvZ4g1knWXnH9PaoxW POdNTsOUxb5DGG+xDOr8ArUO7GPyCKDV/rk1vNFnQACNa35JeUf5qf7biGk1yqMo xxMZaSjwJ1LwNpHe2IRlQjsYhpuizneK+rWQ3KKzSaUjasFvuqzJ6CghhIxhTh2g B0GjX0c1LZKIzJ53sv7CtCTDGtJ8PbHLrkC0Be0GvjdDoTLe31BYOegtuxaHW8f6 rVOLLoLGedDvDv+/fOT10oPJINB+pFrWFWWOrzgmxFJynvQvXhJTl3jRaANqYyeW BWCEgcDnEkTcx5xfN2yGgUetlOLfa1Pmyrh7VuIzIbqPwtGFAUwvV2wXhEouzExs f1zqSpcTxaJzAri0HDG3PVUy72UQqRHZZzFZ4op9IBc4fRoNTAoc2sskWqzt+NJE 2kDlzjOqRnZfTkj/ePSemdWzxdQZpld2Rv9VqvzdGmuiW9AX/G2hzBAud2sqqZeM XGgbxEMjJuLRlgApjVch0tD24LYA4Mw4xMxb8ZqyPKUhBSaxTNMOsciz5UQakyPJ C1hS5XobHWyUdRTfXnDHhSh4KSKS1giBb2ohQ1bSuPbhyWZYqDU85GteAo0tAesE DkNQreHBFgOTjfOgY09XaZX1eh+nj9CjQWznUtLzEnh2HNfMt7c= =4QP4 -----END PGP SIGNATURE----- --DgVsMDQ1VLMzsPv4--