diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2024-10-24 15:59:22 +1100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2024-10-25 14:29:46 +0200 |
commit | e7fcd0c3481f15395ea4060eadfac0b6a8f69b29 (patch) | |
tree | 45701c4a95bf7bbfec2800669e32f56f011ef8a2 /Makefile | |
parent | 81143813a6b3ec297c31d234bbdc6000ed8c7052 (diff) | |
download | passt-e7fcd0c3481f15395ea4060eadfac0b6a8f69b29.tar passt-e7fcd0c3481f15395ea4060eadfac0b6a8f69b29.tar.gz passt-e7fcd0c3481f15395ea4060eadfac0b6a8f69b29.tar.bz2 passt-e7fcd0c3481f15395ea4060eadfac0b6a8f69b29.tar.lz passt-e7fcd0c3481f15395ea4060eadfac0b6a8f69b29.tar.xz passt-e7fcd0c3481f15395ea4060eadfac0b6a8f69b29.tar.zst passt-e7fcd0c3481f15395ea4060eadfac0b6a8f69b29.zip |
tcp: Use runtime tests for TCP_INFO fields
In order to use particular fields from the TCP_INFO getsockopt() we
need them to be in structure returned by the runtime kernel. We attempt
to determine that with the HAS_BYTES_ACKED and HAS_MIN_RTT defines, probed
in the Makefile.
However, that's not correct, because the kernel headers we compile against
may not be the same as the runtime kernel. We instead should check against
the size of structure returned from the TCP_INFO getsockopt() as we already
do for tcpi_snd_wnd. Switch from the compile time flags to a runtime
test.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 10 |
1 files changed, 0 insertions, 10 deletions
@@ -67,16 +67,6 @@ PASST_HEADERS = arch.h arp.h checksum.h conf.h dhcp.h dhcpv6.h flow.h fwd.h \ udp.h udp_flow.h util.h HEADERS = $(PASST_HEADERS) seccomp.h -C := \#include <linux/tcp.h>\nstruct tcp_info x = { .tcpi_bytes_acked = 0 }; -ifeq ($(shell printf "$(C)" | $(CC) -S -xc - -o - >/dev/null 2>&1; echo $$?),0) - FLAGS += -DHAS_BYTES_ACKED -endif - -C := \#include <linux/tcp.h>\nstruct tcp_info x = { .tcpi_min_rtt = 0 }; -ifeq ($(shell printf "$(C)" | $(CC) -S -xc - -o - >/dev/null 2>&1; echo $$?),0) - FLAGS += -DHAS_MIN_RTT -endif - C := \#include <sys/random.h>\nint main(){int a=getrandom(0, 0, 0);} ifeq ($(shell printf "$(C)" | $(CC) -S -xc - -o - >/dev/null 2>&1; echo $$?),0) FLAGS += -DHAS_GETRANDOM |