Commit 7ce1c092 authored by Konstantin Shkolnyy's avatar Konstantin Shkolnyy Committed by Paolo Abeni
Browse files

vsock/test: fix failures due to wrong SO_RCVLOWAT parameter



This happens on 64-bit big-endian machines.
SO_RCVLOWAT requires an int parameter. However, instead of int, the test
uses unsigned long in one place and size_t in another. Both are 8 bytes
long on 64-bit machines. The kernel, having received the 8 bytes, doesn't
test for the exact size of the parameter, it only cares that it's >=
sizeof(int), and casts the 4 lower-addressed bytes to an int, which, on
a big-endian machine, contains 0. 0 doesn't trigger an error, SO_RCVLOWAT
returns with success and the socket stays with the default SO_RCVLOWAT = 1,
which results in vsock_test failures, while vsock_perf doesn't even notice
that it's failed to change it.

Fixes: b1346338 ("vsock_test: POLLIN + SO_RCVLOWAT test")
Fixes: 542e893f ("vsock/test: two tests to check credit update logic")
Fixes: 8abbffd2 ("test/vsock: vsock_perf utility")
Signed-off-by: default avatarKonstantin Shkolnyy <kshk@linux.ibm.com>
Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 4615855e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment