Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests: drv-net: adjust to socat changes

socat v1.8.1.0 now defaults to shut-null, it sends an extra
0-length UDP packet when sender disconnects. This breaks
our tests which expect the exact packet sequence.

Add shut-none which was the old default where necessary.

Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Reviewed-by: Joe Damato <joe@dama.to>
Reviewed-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20260404230103.2719103-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+5 -5
+3 -3
tools/testing/selftests/drivers/net/lib/sh/lib_netcons.sh
··· 251 251 252 252 # Just wait for 3 seconds 253 253 timeout 3 ip netns exec "${NAMESPACE}" \ 254 - socat "${SOCAT_MODE}":"${PORT}",fork "${OUTPUT}" 2> /dev/null 254 + socat "${SOCAT_MODE}":"${PORT}",fork,shut-none "${OUTPUT}" 2> /dev/null 255 255 } 256 256 257 257 # Only validate that the message arrived properly ··· 360 360 361 361 # This is necessary if running multiple tests in a row 362 362 function pkill_socat() { 363 - PROCESS_NAME4="socat UDP-LISTEN:6666,fork ${OUTPUT_FILE}" 364 - PROCESS_NAME6="socat UDP6-LISTEN:6666,fork ${OUTPUT_FILE}" 363 + PROCESS_NAME4="socat UDP-LISTEN:6666,fork,shut-none ${OUTPUT_FILE}" 364 + PROCESS_NAME6="socat UDP6-LISTEN:6666,fork,shut-none ${OUTPUT_FILE}" 365 365 # socat runs under timeout(1), kill it if it is still alive 366 366 # do not fail if socat doesn't exist anymore 367 367 set +e
+2 -2
tools/testing/selftests/drivers/net/xdp.py
··· 70 70 cfg.require_cmd("socat", remote=True) 71 71 72 72 rx_udp_cmd = f"socat -{cfg.addr_ipver} -T 2 -u UDP-RECV:{port},reuseport STDOUT" 73 - tx_udp_cmd = f"echo -n {test_string} | socat -t 2 -u STDIN UDP:{cfg.baddr}:{port}" 73 + tx_udp_cmd = f"echo -n {test_string} | socat -t 2 -u STDIN UDP:{cfg.baddr}:{port},shut-none" 74 74 75 75 with bkg(rx_udp_cmd, exit_wait=True) as nc: 76 76 wait_port_listen(port, proto="udp") ··· 271 271 # Writing zero bytes to stdin gets ignored by socat, 272 272 # but with the shut-null flag socat generates a zero sized packet 273 273 # when the socket is closed. 274 - tx_cmd_suffix = ",shut-null" if payload_len == 0 else "" 274 + tx_cmd_suffix = ",shut-null" if payload_len == 0 else ",shut-none" 275 275 tx_udp = f"echo -n {test_string} | socat -t 2 " + \ 276 276 f"-u STDIN UDP:{cfg.baddr}:{port}{tx_cmd_suffix}" 277 277