aboutgitcodebugslistschat
path: root/Makefile
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-10-21 01:19:27 +0200
committerStefano Brivio <sbrivio@redhat.com>2021-10-21 01:19:27 +0200
commit849308d20716f40452e70a230f3a403ee88b207d (patch)
tree178d07059fb5a95c1d8c9cf923be4dd532fa274d /Makefile
parenta20626fb3516169c8c06bd1729cf29465d2cbd1f (diff)
downloadpasst-849308d20716f40452e70a230f3a403ee88b207d.tar
passt-849308d20716f40452e70a230f3a403ee88b207d.tar.gz
passt-849308d20716f40452e70a230f3a403ee88b207d.tar.bz2
passt-849308d20716f40452e70a230f3a403ee88b207d.tar.lz
passt-849308d20716f40452e70a230f3a403ee88b207d.tar.xz
passt-849308d20716f40452e70a230f3a403ee88b207d.tar.zst
passt-849308d20716f40452e70a230f3a403ee88b207d.zip
Makefile, tcp: Don't try to use tcpi_snd_wnd from tcp_info on pre-5.3 kernels
Detect missing tcpi_snd_wnd in struct tcp_info at build time, otherwise build fails with a pre-5.3 linux/tcp.h header. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 85d7400..83140ad 100644
--- a/Makefile
+++ b/Makefile
@@ -29,6 +29,11 @@ endif
endif
endif
+C := \#include <linux/tcp.h>\nstruct tcp_info x = { .tcpi_snd_wnd = 0 };
+ifeq ($(shell printf "$(C)" | $(CC) -S -xc - -o - >/dev/null 2>&1; echo $$?),0)
+ CFLAGS += -DHAS_SND_WND
+endif
+
prefix ?= /usr/local
all: passt pasta passt4netns qrap