Skip to content

Ensure upstream is closed properly in main function#87

Open
maederm wants to merge 1 commit into
ameshkov:masterfrom
maederm:bugfix/close-connection-to-upstream
Open

Ensure upstream is closed properly in main function#87
maederm wants to merge 1 commit into
ameshkov:masterfrom
maederm:bugfix/close-connection-to-upstream

Conversation

@maederm

@maederm maederm commented Apr 11, 2026

Copy link
Copy Markdown

Dnslookup doesn't close the upstream handle. This can lead to ICMP port unreachable errors from client to server.

I assume that dnslookup already exits before the quic sessions is terminated. The server then wants to close the connection and because the socket is already closed the kernel sends the ICMP unreachables.

After ensuring that dnslookup closes the handle before it exits I only rarely see ICMP unreachables.

Reproducer

The ICMP unreachables can reproduced with these commands:

sudo tcpdump -i {outgoing interface} -np host 9.9.9.9
dnslookup example.com quic://9.9.9.9

Without the patch I see these in tcpdump:

14:18:28 IP 192.168.x.y  > 9.9.9.9: ICMP 192.168.34.170 udp port 46103 unreachable, length 130
14:18:28 IP 192.168.x.y  > 9.9.9.9: ICMP 192.168.34.170 udp port 46103 unreachable, length 130
14:18:28 IP 192.168.x.y  > 9.9.9.9: ICMP 192.168.34.170 udp port 46103 unreachable, length 63
14:18:29 IP 192.168.x.y  > 9.9.9.9: ICMP 192.168.34.170 udp port 46103 unreachable, length 130
14:18:29 IP 192.168.x.y  > 9.9.9.9: ICMP 192.168.34.170 udp port 46103 unreachable, length 63

@maederm maederm force-pushed the bugfix/close-connection-to-upstream branch from 68020b0 to b95db79 Compare June 14, 2026 17:37
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