]> Gentwo Git Trees - linux/.git/commit
selftests/bpf: Use sockaddr_storage directly in cls_redirect test
authorHoyeon Lee <hoyeon.lee@suse.com>
Fri, 21 Nov 2025 08:13:31 +0000 (17:13 +0900)
committerMartin KaFai Lau <martin.lau@kernel.org>
Fri, 21 Nov 2025 18:46:01 +0000 (10:46 -0800)
commitfd6ed07a05dc107605c50c786f9705d717bc0b30
treea674330cd63cb7b85b1e8f0b25092d12d642b878
parente0940c672ab4228caa33bcd7cc0ad8017482c2f1
selftests/bpf: Use sockaddr_storage directly in cls_redirect test

The cls_redirect test uses a custom addr_port/tuple wrapper to represent
IPv4/IPv6 addresses and ports. This custom wrapper requires extra
conversion logic and specific helpers such as fill_addr_port(), which
are no longer necessary when using standard socket address structures.

This commit replaces addr_port/tuple with the standard sockaddr_storage
so test handles address families and ports using native socket types.
It removes the custom helper, eliminates redundant casts, and simplifies
the setup helpers without functional changes. set_up_conn() and
build_input() now take src/dst sockaddr_storage directly.

Reviewed-by: Amery Hung <ameryhung@gmail.com>
Signed-off-by: Hoyeon Lee <hoyeon.lee@suse.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://patch.msgid.link/20251121081332.2309838-2-hoyeon.lee@suse.com
tools/testing/selftests/bpf/prog_tests/cls_redirect.c