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

net: consider dns addresses as public #219

Closed
wants to merge 1 commit into from

Conversation

sukunrt
Copy link
Member

@sukunrt sukunrt commented Sep 7, 2023

This resolves the discussion here: libp2p/go-libp2p#2553 (review)

For some users this might cause unexpected behaviour e.g. here it looks like the user does want this function to return true only for IP addresses. I can imagine there are some others who want this.

Most of the cases I eyeballed are not affected by this change and in some cases are positively impacted as they do expect dns addresses to pass this check.

Ideally it'd have been nicer if the existing method was IsPublicIPAddr and so we could just add IsPublicAddr with this behaviour.

The suffix check is not too expensive. The method takes 90-100ns with IP addresses. It takes 125ns with dns addresses on my m1 macbook.

@sukunrt sukunrt force-pushed the sukun/public-addr-dns branch from e28b637 to c0880b5 Compare September 7, 2023 09:41
@sukunrt sukunrt closed this Sep 7, 2023
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.

1 participant