Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying IPv6 sockets w/ IPv6 being available but down, leads to connection failures #72

Open
erikarn opened this issue Apr 9, 2024 · 2 comments

Comments

@erikarn
Copy link

erikarn commented Apr 9, 2024

This is ... kinda silly? I'm going to work around it for now by using -b but it would be nice to update socket logic to try different hosts.

The TL;DR is:

  • resolve() returns the host list
  • connect_socks_target() only tries /one/ entry in the list
  • github.com returns only A records
  • freebsd.org git repo IPs return AAAA and A records
  • my interfaces have local v6 addresses but currently (for stupid reasons) no global v6 addresses
  • so, if I try connecting to freebsd.org hosts, it will see AAAA is likely fine, bind() ok, connect() hits "HOST_UNREACHABLE" and bam.

It would be nice if instead it could loop over the hosts returned by getaddrinfo() and try them until one succeeds?

@rofl0r
Copy link
Owner

rofl0r commented Apr 9, 2024

you could also patch resolve to use either AF_INET or AF_INET6 for hints instead of AF_UNSPEC.
the code kinda expects that one has his internet connectivity properly set up. maybe i'll take a look at implementing a loop here, but it's the first time anyone complains.

@erikarn
Copy link
Author

erikarn commented Apr 10, 2024 via email

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

No branches or pull requests

2 participants