Browse Source

Fix UDP listen on a Unspecified Address and Dial from the Unspecified Address

LocalMultiaddr May return the Unspecified Address, if so, we need to
check if we listen on the Unspecified address and they were equal.
pull/561/head
lnykww 6 years ago
parent
commit
5da711dc6c
  1. 2
      p2p/protocol/identify/id.go

2
p2p/protocol/identify/id.go

@ -413,7 +413,7 @@ func (ids *IDService) consumeObservedAddress(observed []byte, c inet.Conn) {
}
log.Debugf("identify identifying observed multiaddr: %s %s", c.LocalMultiaddr(), ifaceaddrs)
if !addrInAddrs(c.LocalMultiaddr(), ifaceaddrs) {
if !addrInAddrs(c.LocalMultiaddr(), ifaceaddrs) && !addrInAddrs(c.LocalMultiaddr(), ids.Host.Network().ListenAddresses()) {
// not in our list
return
}

Loading…
Cancel
Save