public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* [PATCH] Add missing explicit PSH assignment
@ 2025-09-05 23:56 Volker Diels-Grabsch
  2025-09-06 20:20 ` Stefano Brivio
  0 siblings, 1 reply; 3+ messages in thread
From: Volker Diels-Grabsch @ 2025-09-05 23:56 UTC (permalink / raw)
  To: passt-dev; +Cc: Volker Diels-Grabsch

For packets with data, we set the PSH flag depending on whether it's
the last chunk of data in a single receive operation from a socket.
But then we reuse the same buffers for SYN segments, and oops, PSH is
set randomly.

This change cleans this up by setting PSH explicitly, just as we do
with the other flags.
---
 tcp.c          | 1 +
 tcp_internal.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/tcp.c b/tcp.c
index dba5fdc..a27b069 100644
--- a/tcp.c
+++ b/tcp.c
@@ -1176,6 +1176,7 @@ int tcp_prepare_flags(const struct ctx *c, struct tcp_tap_conn *conn,
 	th->doff = (sizeof(*th) + *optlen) / 4;
 
 	th->ack = !!(flags & ACK);
+	th->psh = !!(flags & PSH);
 	th->rst = !!(flags & RST);
 	th->syn = !!(flags & SYN);
 	th->fin = !!(flags & FIN);
diff --git a/tcp_internal.h b/tcp_internal.h
index 36c6533..9dae688 100644
--- a/tcp_internal.h
+++ b/tcp_internal.h
@@ -26,6 +26,7 @@
 #define FIN		(1 << 0)
 #define SYN		(1 << 1)
 #define RST		(1 << 2)
+#define PSH		(1 << 3)
 #define ACK		(1 << 4)
 
 /* Flags for internal usage */
-- 
@@ -26,6 +26,7 @@
 #define FIN		(1 << 0)
 #define SYN		(1 << 1)
 #define RST		(1 << 2)
+#define PSH		(1 << 3)
 #define ACK		(1 << 4)
 
 /* Flags for internal usage */
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Add missing explicit PSH assignment
  2025-09-05 23:56 [PATCH] Add missing explicit PSH assignment Volker Diels-Grabsch
@ 2025-09-06 20:20 ` Stefano Brivio
  2025-09-07 10:40   ` Volker Diels-Grabsch
  0 siblings, 1 reply; 3+ messages in thread
From: Stefano Brivio @ 2025-09-06 20:20 UTC (permalink / raw)
  To: Volker Diels-Grabsch; +Cc: passt-dev

On Sat,  6 Sep 2025 01:56:18 +0200
Volker Diels-Grabsch <v@njh.eu> wrote:

> For packets with data, we set the PSH flag depending on whether it's
> the last chunk of data in a single receive operation from a socket.
> But then we reuse the same buffers for SYN segments, and oops, PSH is
> set randomly.
> 
> This change cleans this up by setting PSH explicitly, just as we do
> with the other flags.

Thanks, applied, and welcome to the git log!

For the future: it would be nice if you could use the Signed-off-by:
tag to imply all this stuff: https://developercertificate.org/. Here I
added it for you as an exception as I know that it's clearly the case,
and the change is trivial.

By the way, 'git commit --signoff' adds it.

-- 
Stefano


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Add missing explicit PSH assignment
  2025-09-06 20:20 ` Stefano Brivio
@ 2025-09-07 10:40   ` Volker Diels-Grabsch
  0 siblings, 0 replies; 3+ messages in thread
From: Volker Diels-Grabsch @ 2025-09-07 10:40 UTC (permalink / raw)
  To: Stefano Brivio; +Cc: passt-dev

Stefano Brivio wrote:
> For the future: it would be nice if you could use the Signed-off-by:
> tag to imply all this stuff: https://developercertificate.org/. Here I
> added it for you as an exception as I know that it's clearly the case,
> and the change is trivial.
> 
> By the way, 'git commit --signoff' adds it.

Thanks for the hint!  I will re-send my third patch:

    "Send an initial ARP request to resolve the guest IP address"

again to this list, including a proper "Signed-off-by" tag.


Best regards,
Volker

-- 
.---<<<((()))>>>---.
|      [[||]]      |
'---<<<((()))>>>---'

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-09-07 10:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-05 23:56 [PATCH] Add missing explicit PSH assignment Volker Diels-Grabsch
2025-09-06 20:20 ` Stefano Brivio
2025-09-07 10:40   ` Volker Diels-Grabsch

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).