SSU: Fix transition from firewalled to non-firewalled

This commit is contained in:
zzz
2015-01-29 22:23:28 +00:00
parent 175806115b
commit 84cf531f5f
3 changed files with 15 additions and 4 deletions

View File

@ -5,6 +5,7 @@
due to a different ordering of the same introducers due to a different ordering of the same introducers
- Don't publish an address if we need introducers but don't have any, - Don't publish an address if we need introducers but don't have any,
so the user won't see a 'firewalled with inbound NTCP enabled' message so the user won't see a 'firewalled with inbound NTCP enabled' message
- Fix transition from firewalled to non-firewalled
2015-01-28 zzz 2015-01-28 zzz
* UPnP: * UPnP:

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */ /** deprecated */
public final static String ID = "Monotone"; public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION; public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 14; public final static long BUILD = 15;
/** for example "-test" */ /** for example "-test" */
public final static String EXTRA = ""; public final static String EXTRA = "";

View File

@ -1816,10 +1816,12 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
return rv; return rv;
} }
} else { } else {
RouterAddress cur = getCurrentAddress(false); if (!introducersRequired()) {
RouterAddress cur = getCurrentExternalAddress(false);
if (cur != null) if (cur != null)
host = cur.getHost(); host = cur.getHost();
} }
}
return rebuildExternalAddress(host, port, allowRebuildRouterInfo); return rebuildExternalAddress(host, port, allowRebuildRouterInfo);
} }
@ -1974,6 +1976,14 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
_log.warn("Wanted to rebuild my SSU address, but couldn't specify either the direct or indirect info (needs introducers? " _log.warn("Wanted to rebuild my SSU address, but couldn't specify either the direct or indirect info (needs introducers? "
+ introducersRequired + ")", new Exception("source")); + introducersRequired + ")", new Exception("source"));
_needsRebuild = true; _needsRebuild = true;
// save the external address, even if we didn't publish it
if (port > 0 && host != null) {
OrderedProperties localOpts = new OrderedProperties();
localOpts.setProperty(UDPAddress.PROP_PORT, String.valueOf(port));
localOpts.setProperty(UDPAddress.PROP_HOST, host);
RouterAddress local = new RouterAddress(STYLE, localOpts, DEFAULT_COST);
replaceCurrentExternalAddress(local, isIPv6);
}
if (hasCurrentAddress()) { if (hasCurrentAddress()) {
// We must remove current address, otherwise the user will see // We must remove current address, otherwise the user will see
// "firewalled with inbound NTCP enabled" warning in console. // "firewalled with inbound NTCP enabled" warning in console.