Skip to content

Auto-port 4.1: Kqueue: Fix usage of LOCAL_PEERPID#16646

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

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

Conversation

@netty-project-bot

Copy link
Copy Markdown
Contributor

Auto-port of #16637 to 4.1
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 added this to the 4.1.133.Final milestone Apr 14, 2026
@normanmaurer normanmaurer merged commit 266ba3c into 4.1 Apr 14, 2026
19 checks passed
@normanmaurer normanmaurer deleted the auto-port-pr-16637-to-4.1 branch April 14, 2026 20:07
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