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

Problems with connecting to IPv6 only address #147

Closed
torhve opened this issue May 26, 2016 · 4 comments
Closed

Problems with connecting to IPv6 only address #147

torhve opened this issue May 26, 2016 · 4 comments

Comments

@torhve
Copy link

torhve commented May 26, 2016

Trying to connect with

print(require"cqueues.socket".connect("ipv6.xt.gg", 80):connect())

gives result:

lua: /usr/local/share/lua/5.1/cqueues/socket.lua:263: socket:connect: The name does not resolve for the supplied parameters

ipv6.xt.gg only has AAAA record

@daurnimator
Copy link
Collaborator

daurnimator commented May 26, 2016

replicated locally.

Now that I'm looking, the cause is obvious from the code in socket.c:

        if (!(S->socket = so_open(host, port, DNS_T_A, family, type, &opts, &error)))

The code only does a lookup for A records.

Solutions are probably related to wahern/dns#2 or #78

@wahern
Copy link
Owner

wahern commented May 31, 2016

I'm working on adding better IPv6 in dns.c right now--specifically, fixing getaddrinfo-like API to resolve both IPv4 and IPv6, and then fixing up socket.c to make use of it. I'll try to get it out ASAP.

@wahern
Copy link
Owner

wahern commented Jun 8, 2016

I've committed [upstream] dual-family IPv4/IPv6 support in the addrinfo iterator of the embedded dns.c library. Next step is to merge it downsteam into cqueues and fix how so_open and dns_ai_open are called internally.

@wahern
Copy link
Owner

wahern commented Oct 19, 2016

This works for me in the latest release:

RUNLUA_S=regress/.local mk/runlua examples/simple.get "ipv6.xt.gg"

Note this is after running make check, where the runlua script can locate fresh modules under regress/.local.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants