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

snet.UDPAddrFromString resolves hostnames #3654

Closed
matzf opened this issue Feb 5, 2020 · 0 comments · Fixed by #3662
Closed

snet.UDPAddrFromString resolves hostnames #3654

matzf opened this issue Feb 5, 2020 · 0 comments · Fixed by #3662

Comments

@matzf
Copy link
Contributor

matzf commented Feb 5, 2020

After #3650, snet.UDPAddrFromString resolves hostnames in the host part of SCION addresses.
This is at least unexpected.

One example can be found in the testcases:

{address: "1-ff00:0:300,[abc]:12", isError: true},

This test fails for us, as there happens to be a host abc in our network and so this call does not return the expected error.

The cause of this issue is that snet.UDPAddrFromString now uses net.ResolveUDPAddr, which resolves hostnames as documented (emphasis mine):

If the host in the address parameter is not a literal IP address or the port is not a literal port number, ResolveUDPAddr resolves the address to an address of UDP end point. Otherwise, it parses the address as a pair of literal IP address and port number. The address parameter can use a host name, but this is not recommended, because it will return at most one of the host name's IP addresses.

matzf added a commit to matzf/scion that referenced this issue Feb 10, 2020
Parse the host IP, port directly instead of using net.ResolveUDPAddr,
which also resolves hostnames. Hostnames should not be considered inside
SCION addresses.

Fixes scionproto#3654
oncilla pushed a commit that referenced this issue Feb 11, 2020
Parse the host IP, port directly instead of using net.ResolveUDPAddr, which also resolves hostnames. Hostnames should not be considered inside SCION addresses.

Fixes #3654
stygerma pushed a commit to stygerma/scion that referenced this issue Mar 26, 2020
Parse the host IP, port directly instead of using net.ResolveUDPAddr, which also resolves hostnames. Hostnames should not be considered inside SCION addresses.

Fixes scionproto#3654
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 a pull request may close this issue.

1 participant