Commit 106c35dd authored by Jiri Benc's avatar Jiri Benc Committed by Daniel Borkmann

selftests/bpf: More compatible nc options in test_lwt_ip_encap

Out of the three nc implementations widely in use, at least two (BSD netcat
and nmap-ncat) do not support -l combined with -s. Modify the nc invocation
to be accepted by all of them.

Fixes: 17a90a78 ("selftests/bpf: test that GSO works in lwt_ip_encap")
Signed-off-by: default avatarJiri Benc <jbenc@redhat.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/9f177682c387f3f943bb64d849e6c6774df3c5b4.1570539863.git.jbenc@redhat.com
parent fd418b01
...@@ -314,15 +314,15 @@ test_gso() ...@@ -314,15 +314,15 @@ test_gso()
command -v nc >/dev/null 2>&1 || \ command -v nc >/dev/null 2>&1 || \
{ echo >&2 "nc is not available: skipping TSO tests"; return; } { echo >&2 "nc is not available: skipping TSO tests"; return; }
# listen on IPv*_DST, capture TCP into $TMPFILE # listen on port 9000, capture TCP into $TMPFILE
if [ "${PROTO}" == "IPv4" ] ; then if [ "${PROTO}" == "IPv4" ] ; then
IP_DST=${IPv4_DST} IP_DST=${IPv4_DST}
ip netns exec ${NS3} bash -c \ ip netns exec ${NS3} bash -c \
"nc -4 -l -s ${IPv4_DST} -p 9000 > ${TMPFILE} &" "nc -4 -l -p 9000 > ${TMPFILE} &"
elif [ "${PROTO}" == "IPv6" ] ; then elif [ "${PROTO}" == "IPv6" ] ; then
IP_DST=${IPv6_DST} IP_DST=${IPv6_DST}
ip netns exec ${NS3} bash -c \ ip netns exec ${NS3} bash -c \
"nc -6 -l -s ${IPv6_DST} -p 9000 > ${TMPFILE} &" "nc -6 -l -p 9000 > ${TMPFILE} &"
RET=$? RET=$?
else else
echo " test_gso: unknown PROTO: ${PROTO}" echo " test_gso: unknown PROTO: ${PROTO}"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment