forked from I2P_Developers/i2p.i2p
Transports: Don't open UPnP ports for disabled IPv4/v6
This commit is contained in:
@@ -196,6 +196,11 @@ public interface Transport {
|
||||
@Deprecated
|
||||
public void recheckReachability();
|
||||
|
||||
/**
|
||||
* @since 0.9.50 added to interface
|
||||
*/
|
||||
public TransportUtil.IPv6Config getIPv6Config();
|
||||
|
||||
public boolean isBacklogged(Hash peer);
|
||||
|
||||
/**
|
||||
|
||||
@@ -797,10 +797,13 @@ public class TransportManager implements TransportEventListener {
|
||||
port = udp.getRequestedPort();
|
||||
}
|
||||
if (port > 0) {
|
||||
TransportUtil.IPv6Config config = t.getIPv6Config();
|
||||
// ipv4
|
||||
rv.add(new Port(t.getStyle(), port));
|
||||
if (config != TransportUtil.IPv6Config.IPV6_ONLY)
|
||||
rv.add(new Port(t.getStyle(), port));
|
||||
// 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) {
|
||||
RouterAddress ra = t.getCurrentAddress(true);
|
||||
if (ra == null) {
|
||||
if (t.getStyle().equals(UDPTransport.STYLE)) {
|
||||
|
||||
Reference in New Issue
Block a user