forked from I2P_Developers/i2p.i2p
Transport: Don't open UPnP ports when force-firewalled
This commit is contained in:
@@ -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);
|
||||
|
||||
/**
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user