File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -240,6 +240,11 @@ func (ids *IDService) consumeMessage(mes *pb.Identify, c inet.Conn) {
240
240
241
241
// NOTE: Do not add `c.RemoteMultiaddr()` to the peerstore if the remote
242
242
// peer doesn't tell us to do so. Otherwise, we'll advertise it.
243
+ //
244
+ // This can cause an "addr-splosion" issue where the network will slowly
245
+ // gossip and collect observed but unadvertised addresses. Given a NAT
246
+ // that picks random source ports, this can cause DHT nodes to collect
247
+ // many undialable addresses for other peers.
243
248
244
249
// Extend the TTLs on the known (probably) good addresses.
245
250
// Taking the lock ensures that we don't concurrently process a disconnect.
@@ -415,6 +420,11 @@ func (ids *IDService) consumeObservedAddress(observed []byte, c inet.Conn) {
415
420
return
416
421
}
417
422
423
+ if ! HasConsistentTransport (maddr , ids .Host .Addrs ()) {
424
+ log .Debugf ("ignoring observed multiaddr that doesn't match the transports of any addresses we're announcing" , c .RemoteMultiaddr ())
425
+ return
426
+ }
427
+
418
428
// ok! we have the observed version of one of our ListenAddresses!
419
429
log .Debugf ("added own observed listen addr: %s --> %s" , c .LocalMultiaddr (), maddr )
420
430
ids .observedAddrs .Add (maddr , c .LocalMultiaddr (), c .RemoteMultiaddr (),
You can’t perform that action at this time.
0 commit comments