public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Yumei Huang <yuhuang@redhat.com>
To: passt-dev@passt.top
Cc: sbrivio@redhat.com, dgibson@redhat.com, yuhuang@redhat.com
Subject: [PATCH] build: Fix errors of TCP_REPAIR_* undeclared
Date: Mon,  1 Sep 2025 17:45:10 +0800	[thread overview]
Message-ID: <20250901094510.27813-1-yuhuang@redhat.com> (raw)

Fix the following errors on systems with glibc < 2.29:

tcp.c: In function ‘tcp_flow_repair_on’:
tcp.c:2787:38: error: ‘TCP_REPAIR_ON’ undeclared (first use in this function); did you mean ‘TCP_REPAIR’?
  if ((rc = repair_set(c, conn->sock, TCP_REPAIR_ON)))
                                      ^~~~~~~~~~~~~
                                      TCP_REPAIR
tcp.c:2787:38: note: each undeclared identifier is reported only once for each function it appears in
tcp.c: In function ‘tcp_flow_repair_off’:
tcp.c:2807:38: error: ‘TCP_REPAIR_OFF’ undeclared (first use in this function); did you mean ‘TCP_REPAIR’?
  if ((rc = repair_set(c, conn->sock, TCP_REPAIR_OFF)))
                                      ^~~~~~~~~~~~~~
                                      TCP_REPAIR
make: *** [Makefile:94: passt] Error 1

Signed-off-by: Yumei Huang <yuhuang@redhat.com>
---
 linux_dep.h    | 6 ++++++
 passt-repair.c | 1 +
 2 files changed, 7 insertions(+)

diff --git a/linux_dep.h b/linux_dep.h
index 240f50a..c200444 100644
--- a/linux_dep.h
+++ b/linux_dep.h
@@ -135,6 +135,12 @@ struct tcp_info_linux {
 #define CLOSE_RANGE_UNSHARE	(1U << 1)
 #endif
 
+#ifndef TCP_REPAIR_ON
+#define TCP_REPAIR_ON           1
+#define TCP_REPAIR_OFF          0
+#define TCP_REPAIR_OFF_NO_WP    -1      /* Turn off without window probes */
+#endif
+
 __attribute__ ((weak))
 /* cppcheck-suppress funcArgNamesDifferent */
 int close_range(unsigned int first, unsigned int last, int flags) {
diff --git a/passt-repair.c b/passt-repair.c
index 8c59d7e..c3c140f 100644
--- a/passt-repair.c
+++ b/passt-repair.c
@@ -40,6 +40,7 @@
 #include <linux/seccomp.h>
 
 #include "seccomp_repair.h"
+#include "linux_dep.h"
 
 #define SCM_MAX_FD 253 /* From Linux kernel (include/net/scm.h), not in UAPI */
 #define REPAIR_EXT		".repair"
-- 
@@ -40,6 +40,7 @@
 #include <linux/seccomp.h>
 
 #include "seccomp_repair.h"
+#include "linux_dep.h"
 
 #define SCM_MAX_FD 253 /* From Linux kernel (include/net/scm.h), not in UAPI */
 #define REPAIR_EXT		".repair"
-- 
2.44.0


             reply	other threads:[~2025-09-01  9:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-01  9:45 Yumei Huang [this message]
2025-09-01 21:02 ` [PATCH] build: Fix errors of TCP_REPAIR_* undeclared Stefano Brivio
     [not found]   ` <CANsz47k97ovnU1_CQPOH+yi3-xHeo78bsWmMgqaPBO+mTUOqzg@mail.gmail.com>
2025-09-02  7:27     ` 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=20250901094510.27813-1-yuhuang@redhat.com \
    --to=yuhuang@redhat.com \
    --cc=dgibson@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).