Skip to content

tsi_dgram: fix sendto_addr binding for AF_INET6 sockets#658

Open
nohajc wants to merge 1 commit intocontainers:mainfrom
nohajc:tsi-dgram-fix
Open

tsi_dgram: fix sendto_addr binding for AF_INET6 sockets#658
nohajc wants to merge 1 commit intocontainers:mainfrom
nohajc:tsi-dgram-fix

Conversation

@nohajc
Copy link
Copy Markdown
Contributor

@nohajc nohajc commented Apr 30, 2026

I noticed DNS was broken in my alpine VM whenever I added an IPv6 nameserver to /etc/resolv.conf. This change fixes the issue.

  sendto_addr() always bound to SockaddrIn (0.0.0.0:0) regardless of
  socket family, causing the bind to fail silently for AF_INET6 sockets
  and leaving them deaf to incoming datagrams. Store the resolved
  AddressFamily in the proxy and bind to :: when the socket is IPv6.

Signed-off-by: Jan Noha <nohajc@gmail.com>
@mtjhrc
Copy link
Copy Markdown
Collaborator

mtjhrc commented Apr 30, 2026

Thanks for the fix! But actually, I just remembered I was going to fix this but I totally forgot about it: 71d5270
Hmm, my version seems to also handle the unix case, let me re-test that case and maybe open a PR.

I was thinking recently about figuring out how to merge the test - I had trouble setting up a minimal test environment (user namespaces) without running libkrun in podman via crun... But I totally forgot I also fixed the TSI code

@nohajc
Copy link
Copy Markdown
Contributor Author

nohajc commented Apr 30, 2026

Sure, we can use your fix.

Anyway, it seems my users hit this issue couple times already but it wasn't evident whether it was IPv6 related. I only realized this time...

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.

2 participants