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=AqUXru8Y; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 1A9515A028B for ; Wed, 13 Aug 2025 05:27:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202508; t=1755055626; bh=428w23k6T9OdX3ZztMZDKbztx156nM8m81F1DhpN4B4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AqUXru8Y8os1061LHh7jyn57s8w19SU9DSOeR/DvrQeO/ctKJivOApSnjQ2hhdeme bYCoCuS/PCUr8OGH3gzhTWLYNAbMW6h6hYAdznAMriFEZ3GfExEuQgDiA1mcaRx21i 7N/v25WuqpLpRyHk82I4tjAd2rQmu4/nlB/JEuwyOvzZ1Vp7HDQljRNWe7f120WUDI bgrAC28Yu0l8KRiMMk5WRzbwbUSDPKgfw41LA6VYCXJWV3aZ3+DBpJBI3UQB0zIdCH qXCs+LZvXJxqnOqJ6CWLFwRm9hrjnpit7d06HLrAPXb4mbQO7jY8DydvZYXmqWefmN ttE76xMh0XEjQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4c1v1k5V0Sz4xdT; Wed, 13 Aug 2025 13:27:06 +1000 (AEST) Date: Wed, 13 Aug 2025 13:22:21 +1000 From: David Gibson To: Laurent Vivier Subject: Re: [PATCH v8 20/30] tap: Convert tap6_handler() to iov_tail Message-ID: References: <20250805154628.301343-1-lvivier@redhat.com> <20250805154628.301343-21-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="/oDwM//P1rBSLIag" Content-Disposition: inline In-Reply-To: Message-ID-Hash: 3V7VIDAXBPNZY4ROE4STF6JHUJFYYHGT X-Message-ID-Hash: 3V7VIDAXBPNZY4ROE4STF6JHUJFYYHGT 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: 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: --/oDwM//P1rBSLIag Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 08, 2025 at 03:57:04PM +0200, Laurent Vivier wrote: > On 06/08/2025 08:21, David Gibson wrote: > > On Tue, Aug 05, 2025 at 05:46:18PM +0200, Laurent Vivier wrote: > > > Use packet_data() and extract headers using IOV_REMOVE_HEADER() > > > and IOV_PEEK_HEADER() rather than packet_get(). > > >=20 > > > Remove packet_get() as it is not used anymore. > >=20 > > [snip] > > > @@ -896,21 +896,28 @@ resume: > > > for (seq_count =3D 0, seq =3D NULL; i < in->count; i++) { > > > size_t l4len, plen, check; > > > struct in6_addr *saddr, *daddr; > > > + struct ipv6hdr ip6h_storage; > > > + struct ethhdr eh_storage; > > > + struct udphdr uh_storage; > > > const struct ethhdr *eh; > > > const struct udphdr *uh; > > > struct iov_tail data; > > > struct ipv6hdr *ip6h; > > > uint8_t proto; > > > - char *l4h; > > > - eh =3D packet_get(in, i, 0, sizeof(*eh), NULL); > > > + if (!packet_data(in, i, &data)) > > > + return -1; > > > + > > > + eh =3D IOV_REMOVE_HEADER(&data, eh_storage); > > > if (!eh) > > > continue; > > > - ip6h =3D packet_get(in, i, sizeof(*eh), sizeof(*ip6h), &check); > > > + ip6h =3D IOV_PEEK_HEADER(&data, ip6h_storage); > > > if (!ip6h) > > > continue; > >=20 > > You peek the IPv6 header here, but I haven't spotted where you remove > > / drop it before... > >=20 >=20 > In fact, data offset is modified by ipv6_l4hdr() that scans the headers a= nd > the data provided to ipv6_l4hdr() must point to an ipv6hdr (it provides a= lso > the proto that is alloed to do the correct IOV_PEEK_HEADER()). Ah, right. --=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 --/oDwM//P1rBSLIag Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmicBO0ACgkQzQJF27ox 2GfEWg//dcGzonKo6FrESII2UXxxeBsAU/ENRBW+g8p9a2MYL7sezcRhtRzx8dr8 4PwIGV0Igd9O/gLwEZPuEETCV18M4VRrJ1L1uM/iJaCTiMK2Ui7Z7yj0lyVPqula 47DPIQrRKXzH3Kr0crna/zf6UKRvzsp3aAiUNTkOePPiXPc/X0Vt0YyeUiUL8k1s WVGbU+BfAKl9s0wAJpQOD1iF/7vvDiq4hCJGUUDTC2h0rbUiPPKpI1BR1MMQd3C9 eOcIHjSvVZZEJMJvhyAiqske7zZoleGzEyPsxTqJftF61tx7fJ6OyNq+1H0TlknR uEjTnipcfRX1GKJ60m7I3TEdK6Z1Zvx8EID9K1fLesCSk3UCDz6OKJpjtgR4tzFM ee15sQ6gfN3j44+uhTY7zpUynpmMT6g0s8+EI0r1wjyBI3yarXitj0cN/G/DocVZ BCPa6pXwsYZ30LZB7XiLJcPsTXtqfGrodX05uFY38WY5GicExzMi/SD7VE5URxyj 4UtrT97FI8VxcG7yVnhhcSCOZd6TT3KSyKyEsZJWZnyqy55EZ9rT5wyAAX7yuRB2 w6gxruLQ1LibJ8QVG6ipO240fRxxBsBtLwxF8/mP+Zc6VnLMUjaFI+osUNomy/SB wjeZDZ/smhvjtgnI4+ifSb5sH2AHcHjN5nHQWNIXuPrtxYDXyYk= =B1Bc -----END PGP SIGNATURE----- --/oDwM//P1rBSLIag--