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

Added parsing of IPv6 addresses for incoming mDNS requests #990

Merged
merged 2 commits into from
Aug 20, 2020

Conversation

fouge
Copy link
Contributor

@fouge fouge commented Aug 11, 2020

I want to have P2P communication fully based on IPv6, with local discovery using mDNS.
I am a beginner with libp2p so don't hesitate to bring your insights.

@fouge fouge changed the title Added parsing of IPv6 addresses for incomming mDNS requests Added parsing of IPv6 addresses for incoming mDNS requests Aug 11, 2020
@lidel
Copy link
Member

lidel commented Aug 13, 2020

The idea SGTM, the new libp2p/specs/discovery/mdns (which afaik is not yet implemented in GO libs, but is in JS) lists both IPv4 and IPv6: https://github.com/libp2p/specs/blob/master/discovery/mdns.md#find-all-response

Someone familiar with the codebase needs to review this tho.

Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

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

Thanks!

log.Warning("Error parsing multiaddr from mdns entry: ", err)
return
}
} else {
Copy link
Member

Choose a reason for hiding this comment

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

We can deduplicate some of this code.

var addr net.IP
if e.AddrV4 != nil {
    addr = e.AddrV4
} else if e.AddrV6 != nil {
    addr = e.AddrV6
} else {
    return some error
}

// construct the multiaddr

Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

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

Thanks!

@Stebalien Stebalien merged commit b95d6ae into libp2p:master Aug 20, 2020
@aschmahmann aschmahmann mentioned this pull request Sep 22, 2020
72 tasks
dustinxie added a commit to dustinxie/go-libp2p that referenced this pull request Feb 10, 2021
This reverts commit b95d6ae, reversing
changes made to c24d028.
dustinxie added a commit to dustinxie/go-libp2p that referenced this pull request Feb 10, 2021
This reverts commit b95d6ae, reversing
changes made to c24d028.
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.

3 participants