Commit 46ab6f7
committed
selftests/bpf: Fix sendto() message size in lwt_seg6local
This test_progs test fails on 32-bit armhf:
root@qemu-armhf:/usr/libexec/kselftests-bpf# test_progs -a lwt_seg6local
[...]
test_lwt_seg6local:PASS:setup 0 nsec
test_lwt_seg6local:PASS:open ns6 0 nsec
test_lwt_seg6local:PASS:start server 0 nsec
test_lwt_seg6local:PASS:open ns1 0 nsec
test_lwt_seg6local:PASS:start client 0 nsec
test_lwt_seg6local:PASS:build target addr 0 nsec
test_lwt_seg6local:PASS:send packet 0 nsec
test_lwt_seg6local:FAIL:receive packet unexpected receive packet: actual 4 != expected 7
torvalds#183 lwt_seg6local:FAIL
This happens because a sendto() call mistakenly uses 'sizeof(char *)' as
message length rather than the actual string ("foobar\0") size. e.g.
bytes = sendto(cfd, foobar, sizeof(foobar), 0, ...
This likely passed by accident till now because BPF CI only tests 64-bit
targets. Fix by using strlen() to determine the message length.
Fixes: 1041b8b ("selftests/bpf: lwt_seg6local: Move test to test_progs")
Signed-off-by: Tony Ambardar <[email protected]>1 parent 580d0ce commit 46ab6f7
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| |||
0 commit comments