From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>
Cc: Jon Maloy <jmaloy@redhat.com>, passt-dev@passt.top
Subject: Re: [PATCH v11 1/4] tap: break out building of udp header from tap_udp4_send function
Date: Mon, 13 Oct 2025 10:34:20 +1100 [thread overview]
Message-ID: <aOw6_HVFuTwsOV08@zatzit> (raw)
In-Reply-To: <20251010104013.171af1f7@elisabeth>
[-- Attachment #1: Type: text/plain, Size: 2037 bytes --]
On Fri, Oct 10, 2025 at 10:40:13AM +0200, Stefano Brivio wrote:
> On Thu, 6 Mar 2025 13:00:03 -0500
> Jon Maloy <jmaloy@redhat.com> wrote:
>
> > 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.
> >
> > Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> > Signed-off-by: Jon Maloy <jmaloy@redhat.com>
> > ---
> > v2: Fix to satisfy coverity. After feedback from S. Brivio
> > ---
> > tap.c | 34 +++++++++++++++++++++++++++-------
> > tap.h | 5 +++++
> > 2 files changed, 32 insertions(+), 7 deletions(-)
> >
> > 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, struct in_addr src,
> > }
> >
> > /**
> > - * 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, struct 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 sport,
>
> 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.
>
> Please fix this.
Jon, I'll take care of this - needed a quick warm up exercise :).
--
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2025-10-12 23:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-06 18:00 [PATCH v11 0/4] Reconstruct incoming ICMP headers for failed UDP connect and forward back Jon Maloy
2025-03-06 18:00 ` [PATCH v11 1/4] tap: break out building of udp header from tap_udp4_send function Jon Maloy
2025-10-10 8:40 ` Stefano Brivio
2025-10-12 23:34 ` David Gibson [this message]
2025-03-06 18:00 ` [PATCH v11 2/4] udp: create and send ICMPv4 to local peer when applicable Jon Maloy
2025-03-06 18:00 ` [PATCH v11 3/4] tap: break out building of udp header from tap_udp6_send function Jon Maloy
2025-10-10 8:40 ` Stefano Brivio
2025-03-06 18:00 ` [PATCH v11 4/4] udp: create and send ICMPv6 to local peer when applicable Jon Maloy
2025-03-07 6:30 ` [PATCH v11 0/4] Reconstruct incoming ICMP headers for failed UDP connect and forward back Stefano Brivio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aOw6_HVFuTwsOV08@zatzit \
--to=david@gibson.dropbear.id.au \
--cc=jmaloy@redhat.com \
--cc=passt-dev@passt.top \
--cc=sbrivio@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).