From ad5c2466299ea81b5032802890413673ce9c5f19 Mon Sep 17 00:00:00 2001 From: bol-van Date: Tue, 8 Apr 2025 16:15:06 +0300 Subject: [PATCH] blockcheck: test whether tpws supports fix-seg --- blockcheck.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/blockcheck.sh b/blockcheck.sh index a8278438..0cbbd8f5 100755 --- a/blockcheck.sh +++ b/blockcheck.sh @@ -341,6 +341,12 @@ netcat_test() } } +tpws_can_fix_seg() +{ + # fix-seg requires kernel 4.6+ + "$TPWS" --port 1 --dry-run --fix-seg >/dev/null 2>/dev/null +} + check_system() { echo \* checking system @@ -355,7 +361,12 @@ check_system() Linux) PKTWS="$NFQWS" PKTWSD=nfqws - FIX_SEG='--fix-seg' + if tpws_can_fix_seg ; then + echo tpws supports --fix-seg on this system + FIX_SEG='--fix-seg' + else + echo tpws does not support --fix-seg on this system + fi linux_fwtype [ "$FWTYPE" = iptables -o "$FWTYPE" = nftables ] || { echo firewall type $FWTYPE not supported in $UNAME