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

Avoid net.ResolveUDPAddr in snet.UDPAddrFromString #3662

Merged
merged 4 commits into from
Feb 11, 2020

Conversation

matzf
Copy link
Contributor

@matzf matzf commented 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 #3654


This change is Reviewable

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
@matzf matzf requested a review from oncilla February 11, 2020 10:02
Copy link
Contributor

@oncilla oncilla left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @matzf)


go/lib/snet/udpaddr.go, line 79 at r1 (raw file):

	}
	port, err := strconv.Atoi(rawPort)
	if err != nil || 0 > port || port > 65535 {

use strconv.ParseUint(rawPort, 10, 16) instead

Copy link
Contributor Author

@matzf matzf left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @oncilla)


go/lib/snet/udpaddr.go, line 79 at r1 (raw file):

Previously, Oncilla wrote…

use strconv.ParseUint(rawPort, 10, 16) instead

Done.

Copy link
Contributor

@oncilla oncilla left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@oncilla oncilla merged commit b502b46 into scionproto:master Feb 11, 2020
stygerma pushed a commit to stygerma/scion that referenced this pull request 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
@matzf matzf deleted the fix-udpaddr-parse branch April 23, 2021 09:11
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.

snet.UDPAddrFromString resolves hostnames
2 participants