Skip to content

Auto-port 5.0: Kqueue: Fix usage of LOCAL_PEERPID#16645

Merged
normanmaurer merged 1 commit into
5.0from
auto-port-pr-16637-to-5.0
Apr 14, 2026
Merged

Auto-port 5.0: Kqueue: Fix usage of LOCAL_PEERPID#16645
normanmaurer merged 1 commit into
5.0from
auto-port-pr-16637-to-5.0

Conversation

@netty-project-bot

Copy link
Copy Markdown
Contributor

Auto-port of #16637 to 5.0
Cherry-picked commit: e0ca1e1


Motivation:

SOCK_STREAM (value 1) was being passed as the socket option level, but LOCAL_PEERPID is a Unix domain socket option that lives under SOL_LOCAL. Using SOCK_STREAM as the level
would cause getsockopt to look in the wrong protocol layer — on most kernels this silently returns EOPNOTSUPP or wrong data rather than a hard error, so it was easy to miss.

Modifications:

  • Replace SOCK_STREAM with SOL_LOCAL

Result:

LOCAL_PEERPID works as expected on MacOS / BSD

Motivation:

SOCK_STREAM (value 1) was being passed as the socket option level, but
LOCAL_PEERPID is a Unix domain socket option that lives under SOL_LOCAL.
Using SOCK_STREAM as the level
would cause getsockopt to look in the wrong protocol layer — on most
kernels this silently returns EOPNOTSUPP or wrong data rather than a
hard error, so it was easy to miss.

Modifications:

- Replace SOCK_STREAM with SOL_LOCAL

Result:

LOCAL_PEERPID works as expected on MacOS / BSD

(cherry picked from commit e0ca1e1)
@normanmaurer normanmaurer merged commit ca1d5d4 into 5.0 Apr 14, 2026
12 of 13 checks passed
@normanmaurer normanmaurer deleted the auto-port-pr-16637-to-5.0 branch April 14, 2026 20:19
@normanmaurer normanmaurer added this to the 5.0.0.Final milestone Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants