#!/bin/bash have_socat="no" socat -h > /dev/null && have_socat="yes" ip link set lo up $NFT -f /dev/stdin < connect fails with eperm) socat -u STDIN TCP:127.0.0.1:22345,connect-timeout=1 < /dev/null > /dev/null # can't validate via dump file, syn rexmit can cause counters to be > 1 in rare cases. $NFT list counter inet t nomatchc # nomatchc must be 0. $NFT list counter inet t nomatchc | grep -q "packets 0" || exit 1 # these counters must not be 0. for nz in sackpermc maxsegc nopc; do $NFT list counter inet t $nz $NFT list counter inet t $nz | grep -q "packets 0" && exit 1 done exit 0