Commit 6a4bd31f authored by Fushuai Wang's avatar Fushuai Wang Committed by Alexei Starovoitov
Browse files

selftests/bpf: fix signedness bug in redir_partial()



When xsend() returns -1 (error), the check 'n < sizeof(buf)' incorrectly
treats it as success due to unsigned promotion. Explicitly check for -1
first.

Fixes: a4b7193d ("selftests/bpf: Add sockmap test for redirecting partial skb data")
Signed-off-by: default avatarFushuai Wang <wangfushuai@baidu.com>
Link: https://lore.kernel.org/r/20250612084208.27722-1-wangfushuai@baidu.com


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 3d71b8b9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment