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

DNS resolver returns SocketAddr which has meaningless port #2516

Closed
malaire opened this issue Apr 27, 2021 · 5 comments
Closed

DNS resolver returns SocketAddr which has meaningless port #2516

malaire opened this issue Apr 27, 2021 · 5 comments

Comments

@malaire
Copy link

malaire commented Apr 27, 2021

DNS resolver returns SocketAddr with port even though port would only be meaningful if service is specified for underlying getaddrinfo. However that is not possible as DNS resolver only takes Name as input.

I think this should be fixed by changing return value to IpAddr instead of SocketAddr.

Alternatively DNS resolver could be changed to take service as input in addition to Name

@seanmonstar
Copy link
Member

It used to resolve to IpAddrs, but it was changed in #2346, specifically to allow setting the IPv6 zone ID.

@malaire
Copy link
Author

malaire commented Apr 27, 2021

I don't see any mention of SocketAddrV6 supporting zone ID? How is that feature used here?

@seanmonstar
Copy link
Member

The scope ID is another name for zone ID.

@malaire
Copy link
Author

malaire commented Apr 27, 2021

That can't work as zone ID is string while scope ID is integer?

@malaire
Copy link
Author

malaire commented Apr 27, 2021

Closing this as looks like that does have some use even though I don't see how it could be used (but then I havn't really used ipv6).

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