forked from I2P_Developers/i2p.i2p
Transport: Fix NTCP removing IPv4 address when SSU removes IPv6 address
This commit is contained in:
@@ -323,21 +323,19 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
|
||||
if (ip != null || port > 0)
|
||||
_manager.externalAddressReceived(Transport.AddressSource.SOURCE_SSU, ip, port);
|
||||
else
|
||||
notifyRemoveAddress(false);
|
||||
notifyRemoveAddress(udpAddr);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tell other transports our address changed
|
||||
*
|
||||
* @param address non-null; but address's host/IP may be null
|
||||
* @param address may be null; or address's host/IP may be null
|
||||
* @since 0.9.20
|
||||
*/
|
||||
@Override
|
||||
public void notifyRemoveAddress(RouterAddress address) {
|
||||
// just keep this simple for now, multiple v4 or v6 addresses not yet supported
|
||||
notifyRemoveAddress(address != null &&
|
||||
address.getIP() != null &&
|
||||
address.getIP().length == 16);
|
||||
notifyRemoveAddress(address != null && TransportUtil.isIPv6(address));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -124,6 +124,8 @@ public abstract class TransportUtil {
|
||||
/**
|
||||
* Addresses without a host (i.e. w/introducers)
|
||||
* are assumed to be IPv4 unless a '6' cap is present
|
||||
*
|
||||
* @param addr non-null
|
||||
*/
|
||||
public static boolean isIPv6(RouterAddress addr) {
|
||||
// do this the fast way, without calling getIP() to parse the host string
|
||||
|
||||
Reference in New Issue
Block a user