I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Verified Commit fed3063f authored by zzz's avatar zzz
Browse files

Transport: Don't open UPnP ports when force-firewalled

parent e6f5ab96
No related branches found
No related tags found
No related merge requests found
...@@ -201,6 +201,20 @@ public interface Transport { ...@@ -201,6 +201,20 @@ public interface Transport {
*/ */
public TransportUtil.IPv6Config getIPv6Config(); public TransportUtil.IPv6Config getIPv6Config();
/**
* This returns true if the force-firewalled setting is configured, false otherwise.
*
* @since 0.9.50 added to interface
*/
public boolean isIPv4Firewalled();
/**
* This returns true if the force-firewalled setting is configured, false otherwise.
*
* @since 0.9.50 added to interface
*/
public boolean isIPv6Firewalled();
public boolean isBacklogged(Hash peer); public boolean isBacklogged(Hash peer);
/** /**
......
...@@ -801,11 +801,14 @@ public class TransportManager implements TransportEventListener { ...@@ -801,11 +801,14 @@ public class TransportManager implements TransportEventListener {
if (port > 0) { if (port > 0) {
TransportUtil.IPv6Config config = t.getIPv6Config(); TransportUtil.IPv6Config config = t.getIPv6Config();
// ipv4 // ipv4
if (config != TransportUtil.IPv6Config.IPV6_ONLY) if (config != TransportUtil.IPv6Config.IPV6_ONLY &&
!t.isIPv4Firewalled()) {
rv.add(new Port(t.getStyle(), port)); rv.add(new Port(t.getStyle(), port));
}
// ipv6 // ipv6
if (_context.getProperty(PROP_ENABLE_UPNP_IPV6, DEFAULT_ENABLE_UPNP_IPV6) && if (_context.getProperty(PROP_ENABLE_UPNP_IPV6, DEFAULT_ENABLE_UPNP_IPV6) &&
config != TransportUtil.IPv6Config.IPV6_DISABLED) { config != TransportUtil.IPv6Config.IPV6_DISABLED &&
!t.isIPv6Firewalled()) {
RouterAddress ra = t.getCurrentAddress(true); RouterAddress ra = t.getCurrentAddress(true);
if (ra == null) { if (ra == null) {
if (t.getStyle().equals(UDPTransport.STYLE)) { if (t.getStyle().equals(UDPTransport.STYLE)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment