Skip to content

Commit

Permalink
Revert "Merge pull request libp2p#990 from fouge/feat/mdns-ipv6"
Browse files Browse the repository at this point in the history
This reverts commit b95d6ae, reversing
changes made to c24d028.
  • Loading branch information
dustinxie committed Feb 10, 2021
1 parent fb3179e commit 8a500e1
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions p2p/discovery/mdns.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (m *mdnsService) pollForEntries(ctx context.Context) {
}

func (m *mdnsService) handleEntry(e *mdns.ServiceEntry) {
log.Debugf("Handling MDNS entry: [IPv4 %s][IPv6 %s]:%d %s", e.AddrV4, e.AddrV6, e.Port, e.Info)
log.Debugf("Handling MDNS entry: %s:%d %s", e.AddrV4, e.Port, e.Info)
mpeer, err := peer.IDB58Decode(e.Info)
if err != nil {
log.Warning("Error parsing peer ID from mdns entry: ", err)
Expand All @@ -169,18 +169,8 @@ func (m *mdnsService) handleEntry(e *mdns.ServiceEntry) {
return
}

var addr net.IP
if e.AddrV4 != nil {
addr = e.AddrV4
} else if e.AddrV6 != nil {
addr = e.AddrV6
} else {
log.Warning("Error parsing multiaddr from mdns entry: no IP address found")
return
}

maddr, err := manet.FromNetAddr(&net.TCPAddr{
IP: addr,
IP: e.AddrV4,
Port: e.Port,
})
if err != nil {
Expand Down

0 comments on commit 8a500e1

Please sign in to comment.