Skip to content

ts_netstack_smoltcp_core: fix client reconnect issue#239

Open
dylan-tailscale wants to merge 1 commit into
mainfrom
dylan/accept-fix
Open

ts_netstack_smoltcp_core: fix client reconnect issue#239
dylan-tailscale wants to merge 1 commit into
mainfrom
dylan/accept-fix

Conversation

@dylan-tailscale

Copy link
Copy Markdown
Collaborator

Fixes an issue where we were dropping a half-open socket handle that had moved back to LISTEN rather than closing the socket. This left an orphan socket in the LISTEN state in the netstack's socket set along with the intended LISTEN socket, but typically earlier in iteration order of self.socket_set than the intended socket. The result: in the axum example, packets were delivered to the orphaned LISTEN socket, smoltcp correctly handled the TCP handshake and clients could send an HTTP request, but the server would never respond, as the orphaned socket would complete the handshake and buffer the GET, but process_tcp_listen() would never accept the socket/surface the data to axum, as it had dropped the handle to the orphaned socket.

Updates #26.

Fixes an issue where we were dropping a half-open socket handle that had moved back to LISTEN rather than closing the socket. This left an orphan socket in the LISTEN state in the netstack's socket set along with the intended LISTEN socket, but typically earlier in iteration order of self.socket_set than the intended socket. The result: in the axum example, packets were delivered to the orphaned LISTEN socket, smoltcp correctly handled the TCP handshake and clients could send an HTTP request, but the server would never respond, as the orphaned socket would complete the handshake and buffer the GET, but process_tcp_listen() would never accept the socket/surface the data to axum, as it had dropped the handle to the orphaned socket.

Signed-off-by: Dylan Bargatze <dylan@tailscale.com>
@dylan-tailscale dylan-tailscale self-assigned this Jun 13, 2026
@dylan-tailscale dylan-tailscale added the bug Something isn't working label Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant