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

identify: don't filter dns addresses based on remote addr type #2553

Merged
merged 3 commits into from
Oct 26, 2023

Conversation

sukunrt
Copy link
Member

@sukunrt sukunrt commented Sep 3, 2023

closes: #2550

Copy link
Contributor

@marten-seemann marten-seemann left a comment

Choose a reason for hiding this comment

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

Do we need to make the same change in Kademlia?

Would it make sense to move all of this logic to go-multiaddr? It seems like every protocol that is accepting address advertisements from peers needs exactly the same filtering logic. (If so, we can do that in a follow-up PR, this code looks correct).

@sukunrt
Copy link
Member Author

sukunrt commented Sep 6, 2023

I think it makes sense to modify multiaddr.IsPublicAddr to return true for /dns,/dns4/dns6 addresses, but only in cases where the name is not one of the special use dns names defined in RFC 6761

@marten-seemann
Copy link
Contributor

I think it makes sense to modify multiaddr.IsPublicAddr to return true for /dns,/dns4/dns6 addresses, but only in cases where the name is not one of the special use dns names defined in RFC 6761

Makes sense.

lhAddr := ma.StringCast("/ip4/127.0.0.1/udp/123/quic-v1")
privAddr := ma.StringCast("/ip4/192.168.1.101/tcp/123")
pubAddr := ma.StringCast("/ip6/2::1/udp/123/quic-v1")
dnsAddr := ma.StringCast("/dns/example.com/udp/123/quic-v1")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add a /dns/localhost address here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd prefer adding this when we start using the updated functions in go-multiaddr package.

Copy link
Contributor

Choose a reason for hiding this comment

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

Here's the v0.12 release PR: multiformats/go-multiaddr#223

Copy link
Contributor

Choose a reason for hiding this comment

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

@sukunrt sukunrt force-pushed the sukun/identify-dns branch 2 times, most recently from 6f6a5b7 to c590686 Compare October 25, 2023 17:29
@sukunrt
Copy link
Member Author

sukunrt commented Oct 25, 2023

sorry about the delay. I was procrastinating this thinking autorelay tests would fail, but turns out those tests don't actually use /dns4/localhost anywhere.

@marten-seemann marten-seemann changed the title identify: don't filter dns addresses based on remote addr type identify: add a test for filtering of incoming addresses Oct 26, 2023
@marten-seemann marten-seemann changed the title identify: add a test for filtering of incoming addresses identify: don't filter dns addresses based on remote addr type Oct 26, 2023
@marten-seemann marten-seemann merged commit 6d306bf into master Oct 26, 2023
19 of 20 checks passed
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.

identify: dns addresses shouldn't be filtered out
2 participants