I've encountered a race condition when IPv4 couldn't bind, IPv6 did bind,
the check passed because IPv6 could bind,
but then tlsfuzzer testsuite used IPv4 and failed.
One of the simplest solutions is to filter out IPv6 in the checks.
Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
local PORT=$1
reserve_port $PORT
have_port_finder
- if ! $PFCMD -an|grep "[\:\.]$PORT" >/dev/null 2>&1; then
+ if ! $PFCMD -an|grep -v ::|grep "[\:\.]$PORT" >/dev/null 2>&1; then
return 1
fi
unreserve_port $PORT
check_if_port_listening() {
local PORT=$1
have_port_finder
- $PFCMD -anl|grep "[\:\.]$PORT"|grep LISTEN >/dev/null 2>&1
+ $PFCMD -anl|grep -v ::|grep "[\:\.]$PORT"|grep LISTEN >/dev/null 2>&1
}
# Find a port number not currently in use.