-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Problem
force_reuse_port has two design issues that make it a poor fit for a library crate:
- Blocking
/procscan in async context
force_reuse_port() synchronously iterates /proc/net/tcp and /proc/[pid]/fd/* to locate the process and fd occupying the target port. This runs inside the async mapper setup path.
- Narrow privilege requirements
pidfd_getfd(2) requires the caller to have the same uid as the target process (or be root). In practice, this limits usage to services running
as root — a narrow scenario that does not justify the complexity in a general-purpose library.
Proposal
Move force_reuse_port out of nyat-core:
- Make
LocalAddr::socket()pub, returning a bound socket to the caller nyat-coreonly setsSO_REUSEPORTon its own sockets (passive reuse)- Active forced reuse becomes the caller's responsibility
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels