diff mbox series

[net-next] selftests: netfilter: nft_queue.sh: fix warnings with socat 1.8.0.0

Message ID 20241104142821.2608-1-fw@strlen.de (mailing list archive)
State Accepted
Commit a84e8c05f58305dfa808bc5465c5175c29d7c9b6
Delegated to: Netdev Maintainers
Headers show
Series [net-next] selftests: netfilter: nft_queue.sh: fix warnings with socat 1.8.0.0 | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 3 this patch: 3
netdev/build_tools success Errors and warnings before: 2 (+0) this patch: 2 (+0)
netdev/cc_maintainers warning 9 maintainers not CCed: coreteam@netfilter.org edumazet@google.com pabeni@redhat.com shuah@kernel.org kadlec@netfilter.org linux-kselftest@vger.kernel.org pablo@netfilter.org horms@kernel.org kuba@kernel.org
netdev/build_clang success Errors and warnings before: 3 this patch: 3
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success net selftest script(s) already in Makefile
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 3 this patch: 3
netdev/checkpatch warning WARNING: line length of 100 exceeds 80 columns WARNING: line length of 108 exceeds 80 columns
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-11-04--18-00 (tests: 781)

Commit Message

Florian Westphal Nov. 4, 2024, 2:28 p.m. UTC
Updated to a more recent socat release and saw this:
 socat E xioopen_ipdgram_listen(): unknown address family 0
 socat W address is opened in read-write mode but only supports read-only

First error is avoided via pf=ipv4 option, second one via -u
(unidirectional) mode.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 tools/testing/selftests/net/netfilter/nft_queue.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Antonio Ojea Nov. 5, 2024, 10:41 a.m. UTC | #1
On Mon, 4 Nov 2024 at 14:30, Florian Westphal <fw@strlen.de> wrote:
>
> Updated to a more recent socat release and saw this:
>  socat E xioopen_ipdgram_listen(): unknown address family 0
>  socat W address is opened in read-write mode but only supports read-only
>
> First error is avoided via pf=ipv4 option, second one via -u
> (unidirectional) mode.
>
>

Yeah, I hit that in  7e37e0e , I ended adding the "-4" and "-6" flags
because it was easier to me to reuse the test code, but this LGTM

> # socat 1.8.0 has a bug that requires to specify the IP family to bind (fixed in 1.8.0.1)
patchwork-bot+netdevbpf@kernel.org Nov. 6, 2024, 2:20 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon,  4 Nov 2024 15:28:18 +0100 you wrote:
> Updated to a more recent socat release and saw this:
>  socat E xioopen_ipdgram_listen(): unknown address family 0
>  socat W address is opened in read-write mode but only supports read-only
> 
> First error is avoided via pf=ipv4 option, second one via -u
> (unidirectional) mode.
> 
> [...]

Here is the summary with links:
  - [net-next] selftests: netfilter: nft_queue.sh: fix warnings with socat 1.8.0.0
    https://git.kernel.org/netdev/net-next/c/a84e8c05f583

You are awesome, thank you!
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/netfilter/nft_queue.sh b/tools/testing/selftests/net/netfilter/nft_queue.sh
index a9d109fcc15c..785e3875a6da 100755
--- a/tools/testing/selftests/net/netfilter/nft_queue.sh
+++ b/tools/testing/selftests/net/netfilter/nft_queue.sh
@@ -512,10 +512,10 @@  EOF
 	:> "$TMPFILE1"
 	:> "$TMPFILE2"
 
-	timeout 10 ip netns exec "$ns2" socat UDP-LISTEN:12345,fork OPEN:"$TMPFILE1",trunc &
+	timeout 10 ip netns exec "$ns2" socat UDP-LISTEN:12345,fork,pf=ipv4 OPEN:"$TMPFILE1",trunc &
 	local rpid1=$!
 
-	timeout 10 ip netns exec "$ns3" socat UDP-LISTEN:12345,fork OPEN:"$TMPFILE2",trunc &
+	timeout 10 ip netns exec "$ns3" socat UDP-LISTEN:12345,fork,pf=ipv4 OPEN:"$TMPFILE2",trunc &
 	local rpid2=$!
 
 	ip netns exec "$nsrouter" ./nf_queue -q 12 -d 1000 &
@@ -528,8 +528,8 @@  EOF
 	# Send two packets, one should end up in ns1, other in ns2.
 	# This is because nfqueue will delay packet for long enough so that
 	# second packet will not find existing conntrack entry.
-	echo "Packet 1" | ip netns exec "$ns1" socat STDIN UDP-DATAGRAM:10.6.6.6:12345,bind=0.0.0.0:55221
-	echo "Packet 2" | ip netns exec "$ns1" socat STDIN UDP-DATAGRAM:10.6.6.6:12345,bind=0.0.0.0:55221
+	echo "Packet 1" | ip netns exec "$ns1" socat -u STDIN UDP-DATAGRAM:10.6.6.6:12345,bind=0.0.0.0:55221
+	echo "Packet 2" | ip netns exec "$ns1" socat -u STDIN UDP-DATAGRAM:10.6.6.6:12345,bind=0.0.0.0:55221
 
 	busywait 10000 output_files_written "$TMPFILE1" "$TMPFILE2"