forked from I2P_Developers/i2p.i2p
SSU: Fix outbound IPv6 errors on Windows without a real v6 address
when explict host is set. Validate addresses before confirming that we have an IPv6 address. Possibly related to ticket #1538. javadocs
This commit is contained in:
@@ -18,7 +18,7 @@ public class RouterVersion {
|
||||
/** deprecated */
|
||||
public final static String ID = "Monotone";
|
||||
public final static String VERSION = CoreVersion.VERSION;
|
||||
public final static long BUILD = 11;
|
||||
public final static long BUILD = 12;
|
||||
|
||||
/** for example "-test" */
|
||||
public final static String EXTRA = "";
|
||||
|
@@ -331,6 +331,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
String fixedHost = _context.getProperty(PROP_EXTERNAL_HOST);
|
||||
if (fixedHost != null && fixedHost.length() > 0) {
|
||||
try {
|
||||
// TODO getAllByName(), bind to each
|
||||
String testAddr = InetAddress.getByName(fixedHost).getHostAddress();
|
||||
if (Addresses.getAddresses().contains(testAddr))
|
||||
bindTo = testAddr;
|
||||
@@ -733,8 +734,16 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
_log.warn("Received address: " + Addresses.toString(ip, port) + " from: " + source);
|
||||
if (ip == null)
|
||||
return;
|
||||
// this is essentially isValid(ip), but we can't use that because
|
||||
// _haveIPv6Address is not set yet
|
||||
if (!(isPubliclyRoutable(ip) || allowLocal())) {
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("Invalid address: " + Addresses.toString(ip, port) + " from: " + source);
|
||||
return;
|
||||
}
|
||||
if (source == SOURCE_INTERFACE && ip.length == 16) {
|
||||
// must be set before isValid() call
|
||||
// NOW we can set it, it's a valid v6 address
|
||||
// (we don't want to set this for Teredo, 6to4, ...)
|
||||
_haveIPv6Address = true;
|
||||
}
|
||||
if (explicitAddressSpecified())
|
||||
@@ -742,11 +751,6 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
String sources = _context.getProperty(PROP_SOURCES, DEFAULT_SOURCES);
|
||||
if (!sources.contains(source.toConfigString()))
|
||||
return;
|
||||
if (!isValid(ip)) {
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("Invalid address: " + Addresses.toString(ip, port) + " from: " + source);
|
||||
return;
|
||||
}
|
||||
if (!isAlive()) {
|
||||
if (source == SOURCE_INTERFACE || source == SOURCE_UPNP) {
|
||||
try {
|
||||
|
Reference in New Issue
Block a user