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
- 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
- Fix transition from firewalled to non-firewalled
2015-01-28 zzz
* UPnP:

View File

@ -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 = 14;
public final static long BUILD = 15;
/** for example "-test" */
public final static String EXTRA = "";

View File

@ -1816,10 +1816,12 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
return rv;
}
} else {
RouterAddress cur = getCurrentAddress(false);
if (!introducersRequired()) {
RouterAddress cur = getCurrentExternalAddress(false);
if (cur != null)
host = cur.getHost();
}
}
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? "
+ introducersRequired + ")", new Exception("source"));
_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()) {
// We must remove current address, otherwise the user will see
// "firewalled with inbound NTCP enabled" warning in console.