linux-stable/tools
Kuniyuki Iwashima 5c5fd0acdd selftest: net: Fix weird setsockopt() in bind_bhash.c.
[ Upstream commit fd2004d82d ]

bind_bhash.c passes (SO_REUSEADDR | SO_REUSEPORT) to setsockopt().

In the asm-generic definition, the value happens to match with the
bare SO_REUSEPORT, (2 | 15) == 15, but not on some arch.

arch/alpha/include/uapi/asm/socket.h:18:#define SO_REUSEADDR	0x0004
arch/alpha/include/uapi/asm/socket.h:24:#define SO_REUSEPORT	0x0200
arch/mips/include/uapi/asm/socket.h:24:#define SO_REUSEADDR	0x0004	/* Allow reuse of local addresses.  */
arch/mips/include/uapi/asm/socket.h:33:#define SO_REUSEPORT 0x0200	/* Allow local address and port reuse.  */
arch/parisc/include/uapi/asm/socket.h:12:#define SO_REUSEADDR	0x0004
arch/parisc/include/uapi/asm/socket.h:18:#define SO_REUSEPORT	0x0200
arch/sparc/include/uapi/asm/socket.h:13:#define SO_REUSEADDR	0x0004
arch/sparc/include/uapi/asm/socket.h:20:#define SO_REUSEPORT	0x0200
include/uapi/asm-generic/socket.h:12:#define SO_REUSEADDR	2
include/uapi/asm-generic/socket.h:27:#define SO_REUSEPORT	15

Let's pass SO_REUSEPORT only.

Fixes: c35ecb95c4 ("selftests/net: Add test for timing a bind request to a port with a populated bhash entry")
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250903222938.2601522-1-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-09-09 18:54:16 +02:00
..
accounting
arch
bootconfig
bpf bpftool: Fix memory leak in dump_xx_nlmsg on realloc failure 2025-08-15 12:04:56 +02:00
build tools/build: Don't pass test log files to linker 2025-06-04 14:40:04 +02:00
certs
cgroup
counter
debugging
edid
firewire
firmware
gpio
hv
iio
include bonding: Add independent control state machine 2025-08-28 16:26:18 +02:00
io_uring
kvm/kvm_stat
laptop
leds
lib libbpf: Fix null pointer dereference in btf_dump__free on allocation failure 2025-07-06 10:58:00 +02:00
memory-model
objtool objtool: Properly disable uaccess validation 2025-06-04 14:40:03 +02:00
pci
pcmcia
perf perf tests bp_account: Fix leaked file descriptor 2025-08-15 12:05:03 +02:00
power pm: cpupower: Fix the snapshot-order of tsc,mperf, clock in mperf_stop() 2025-08-28 16:25:54 +02:00
rcu
scripts tools/build: Fix s390(x) cross-compilation with clang 2025-08-28 16:25:53 +02:00
spi
testing selftest: net: Fix weird setsockopt() in bind_bhash.c. 2025-09-09 18:54:16 +02:00
thermal
time
tracing
usb
verification
virtio
vm
wmi
Makefile