Skip to content

Commit 2dc0076

Browse files
committed
Fix latent test issue found with the PR
1 parent fb7e1aa commit 2dc0076

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

wolfssl/test.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,6 +1669,12 @@ static WC_INLINE void tcp_listen(SOCKET_T* sockfd, word16* port, int useAnyAddr,
16691669
if (res < 0)
16701670
err_sys_with_errno("setsockopt SO_REUSEADDR failed\n");
16711671
}
1672+
/* glibc hides SO_REUSEPORT under strict C99 feature-test visibility
1673+
* (no _DEFAULT_SOURCE/__USE_MISC). Fall back to the Linux numeric value
1674+
* so concurrent binds on the same port remain supported. */
1675+
#if defined(__linux__) && !defined(SO_REUSEPORT)
1676+
#define SO_REUSEPORT 15
1677+
#endif
16721678
#ifdef SO_REUSEPORT
16731679
{
16741680
int res, on = 1;

0 commit comments

Comments
 (0)