Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is SO_REUSEPORT only defined for _KERNEL? #1410

Open
bsiegert opened this issue Dec 27, 2023 · 2 comments
Open

Why is SO_REUSEPORT only defined for _KERNEL? #1410

bsiegert opened this issue Dec 27, 2023 · 2 comments

Comments

@bsiegert
Copy link

Hi! pkgsrc developer here. One of our users wanted to compile Caddy (a Go binary) with support for SO_REUSEPORT. I tried adding the definition to golang.org/x/sys using the standard way, which involves taking values from C header files.

I found that commit b98c37d added this support for OmniOS but put the constant into an #ifdef _KERNEL block. This seems wrong to me, since _KERNEL typically switches from user-mode to intra-kernel interfaces. Is this a bug? Or is it deliberate?

/cc @pfmooney, who wrote that code.

@danmcd
Copy link
Member

danmcd commented Dec 27, 2023

SO_REUSEPORT is not generalized, and is there, for now exclusively, for LX brand sockets. Hence the _KERNEL ifdef.

@pfmooney
Copy link

pfmooney commented Jan 3, 2024

To add a little more color: The SO_REUSEPORT implementation added for LX is TCP-only, and really lacking in functionality. It only basically covers the "I want to reload haproxy without closing the socket" use case, and isn't especially robust at that. Because of its shortcomings, it was not exposed to the native system.

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

No branches or pull requests

3 participants