From 849308d20716f40452e70a230f3a403ee88b207d Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Thu, 21 Oct 2021 01:19:27 +0200 Subject: 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 --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 85d7400..83140ad 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,11 @@ endif endif endif +C := \#include \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 -- cgit v1.2.3