diff --git a/router/java/src/net/i2p/router/transport/Transport.java b/router/java/src/net/i2p/router/transport/Transport.java index 4bd26aac6..c71607809 100644 --- a/router/java/src/net/i2p/router/transport/Transport.java +++ b/router/java/src/net/i2p/router/transport/Transport.java @@ -201,6 +201,20 @@ public interface Transport { */ 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); /** diff --git a/router/java/src/net/i2p/router/transport/TransportManager.java b/router/java/src/net/i2p/router/transport/TransportManager.java index 9b895c712..68882f110 100644 --- a/router/java/src/net/i2p/router/transport/TransportManager.java +++ b/router/java/src/net/i2p/router/transport/TransportManager.java @@ -801,11 +801,14 @@ public class TransportManager implements TransportEventListener { if (port > 0) { TransportUtil.IPv6Config config = t.getIPv6Config(); // ipv4 - if (config != TransportUtil.IPv6Config.IPV6_ONLY) + if (config != TransportUtil.IPv6Config.IPV6_ONLY && + !t.isIPv4Firewalled()) { rv.add(new Port(t.getStyle(), port)); + } // 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); if (ra == null) { if (t.getStyle().equals(UDPTransport.STYLE)) {