Skip to content

fix connecting to ipv6 using quinn backend#82

Merged
kixelated merged 3 commits intomoq-dev:mainfrom
sirati:main
Jun 2, 2025
Merged

fix connecting to ipv6 using quinn backend#82
kixelated merged 3 commits intomoq-dev:mainfrom
sirati:main

Conversation

@sirati
Copy link
Contributor

@sirati sirati commented May 30, 2025

currently it is not possible to connect to an Ipv6 address using quinn

the reason for this is the the Url crate converts the Ipv6 host enum variant to a string encompassed in [] i.e. [::1] however during domain name resolution it is not recognized as an ipv6 due to the [] and instead tries to look it up as if it was a domain which of course fails.

here is the code in Url that adds []

Host::Ipv6(ref addr) => {
    f.write_str("[")?;
    write_ipv6(addr, f)?;
    f.write_str("]")
}

they write they do this because of RFC 5952 A Recommendation for IPv6 Address Text Representation

that this causes problems is a known issue

here is the code in tokio that is called by this crate that handles name resolution and tries to parse the ipv6 and fails because of the []

as it is unlikely that either tokio or Url will fix this representation incompatibility i would suggest that the appropriate solution is to never convert to str and then reparse and instead only do name resolution if we are not dealing with an IP

As the host string is also passed to the connect_with function i do not know if it is appropriate to keep the [] so i am not changing that.

Copy link
Collaborator

@kixelated kixelated left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great fix

@sirati
Copy link
Contributor Author

sirati commented Jun 2, 2025

thanks for the fixes
the editor config i did not change tho?

as for the versions, for future reference: i should keep them the same for PRs as they will be automatically incremented?

@kixelated
Copy link
Collaborator

thanks for the fixes the editor config i did not change tho?
I made the change so it matches rustfmt defaults. It's probably not needed, I was just trying to figure out why rustfmt added line breaks.

as for the versions, for future reference: i should keep them the same for PRs as they will be automatically incremented?

They get automatically incremented by release-plz which also makes a (crude) changelog. Bumping them would have worked too.

@kixelated kixelated merged commit bc8ec5d into moq-dev:main Jun 2, 2025
1 check passed
@github-actions github-actions bot mentioned this pull request Jun 2, 2025
This was referenced Feb 18, 2026
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