Skip to content

Kqueue - client Connect dialed the local bind addr, not the remote#182

Open
Vizit0r wants to merge 1 commit into
winddriver:masterfrom
Vizit0r:fix/kqueue-connect-resolved-remote
Open

Kqueue - client Connect dialed the local bind addr, not the remote#182
Vizit0r wants to merge 1 commit into
winddriver:masterfrom
Vizit0r:fix/kqueue-connect-resolved-remote

Conversation

@Vizit0r
Copy link
Copy Markdown

@Vizit0r Vizit0r commented May 29, 2026

TKqueueCrossSocket._Connect built LSockAddr only for the preceding Bind() (address family + ALocalPort, address left zeroed), then passed that same LSockAddr to connect(). On the Kqueue backend (macOS/iOS/BSD) every client connection was therefore dialed to 0.0.0.0:ALocalPort instead of the resolved remote in AAddr, so all outbound connects failed.

Pass the resolved remote (AAddr.ai_addr / ai_addrlen), matching TEpollCrossSocket._Connect in Net.CrossSocket.Epoll.pas.

TKqueueCrossSocket._Connect built LSockAddr only for the preceding Bind() (address family + ALocalPort, address left zeroed), then passed
that same LSockAddr to connect(). On the Kqueue backend (macOS/iOS/BSD) every client connection was therefore dialed to 0.0.0.0:ALocalPort
instead of the resolved remote in AAddr, so all outbound connects failed.

Pass the resolved remote (AAddr.ai_addr / ai_addrlen), matching TEpollCrossSocket._Connect in Net.CrossSocket.Epoll.pas.
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.

1 participant