HomeFreeBSD

tests/socket_afinet: Fix the bind_connected_port test

Description

tests/socket_afinet: Fix the bind_connected_port test

The test verifies that a socket can bind to a local address assigned by
connect(2) to a different socket. It was however trying to bind to the
wrong address, and the check of the result was inverted, so this went
unnoticed. It also needs to set SO_REUSEADDR for this to succeed.

Approved by: re (cperciva)
Reported by: glebius
MFC after: 1 week

(cherry picked from commit d3d0466cae546254c50c80cf3e0c060bbbbba53c)
(cherry picked from commit 9e8d7d83ecfbf8b34b785d7981a29dda567d0bc6)

Details

Provenance
markjAuthored on Apr 20 2026, 3:07 PM
cpercivaCommitted on May 7 2026, 8:39 PM
Parents
rG38c5d60c367e: jail: avoid leaking jail config fds to exec.* hooks
Branches
Unknown
Tags
Unknown