forked from I2P_Developers/i2p.i2p
propagate from branch 'i2p.i2p' (head 1acb4077a56ccb4079538caa28648e27f0bf5b8b)
to branch 'i2p.i2p.zzz.ipv6' (head f87d396c445dc58e677a56d8ed69544c7f5ecab1)
This commit is contained in:
@ -7,7 +7,7 @@ import java.util.Map;
|
||||
|
||||
import net.i2p.router.Router;
|
||||
import net.i2p.router.transport.FIFOBandwidthRefiller;
|
||||
import net.i2p.router.transport.TransportImpl;
|
||||
import net.i2p.router.transport.TransportUtil;
|
||||
import net.i2p.router.transport.TransportManager;
|
||||
import net.i2p.router.transport.udp.UDPTransport;
|
||||
import net.i2p.router.web.ConfigServiceHandler;
|
||||
@ -370,7 +370,8 @@ public class ConfigNetHandler extends FormHandler {
|
||||
addFormError(_("Invalid address") + ": " + addr);
|
||||
return false;
|
||||
}
|
||||
boolean rv = TransportImpl.isPubliclyRoutable(iab);
|
||||
// TODO set IPv6 arg based on configuration?
|
||||
boolean rv = TransportUtil.isPubliclyRoutable(iab, true);
|
||||
if (!rv)
|
||||
addFormError(_("The hostname or IP {0} is not publicly routable", addr));
|
||||
return rv;
|
||||
|
@ -7,7 +7,6 @@ import net.i2p.data.RouterAddress;
|
||||
import net.i2p.router.CommSystemFacade;
|
||||
import net.i2p.router.Router;
|
||||
import net.i2p.router.transport.TransportManager;
|
||||
import net.i2p.router.transport.udp.UDPAddress;
|
||||
import net.i2p.router.transport.udp.UDPTransport;
|
||||
import net.i2p.util.Addresses;
|
||||
|
||||
@ -32,22 +31,15 @@ public class ConfigNetHelper extends HelperBase {
|
||||
return _context.getProperty(PROP_I2NP_NTCP_PORT, "");
|
||||
}
|
||||
|
||||
public String getUdpAddress() {
|
||||
RouterAddress addr = _context.router().getRouterInfo().getTargetAddress("SSU");
|
||||
if (addr == null)
|
||||
return _("unknown");
|
||||
UDPAddress ua = new UDPAddress(addr);
|
||||
return ua.toString();
|
||||
}
|
||||
|
||||
/** @return host or "unknown" */
|
||||
public String getUdpIP() {
|
||||
RouterAddress addr = _context.router().getRouterInfo().getTargetAddress("SSU");
|
||||
if (addr == null)
|
||||
return _("unknown");
|
||||
UDPAddress ua = new UDPAddress(addr);
|
||||
if (ua.getHost() == null)
|
||||
String rv = addr.getHost();
|
||||
if (rv == null)
|
||||
return _("unknown");
|
||||
return ua.getHost();
|
||||
return rv;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -24,7 +24,7 @@ import net.i2p.router.RouterContext;
|
||||
import net.i2p.router.RouterVersion;
|
||||
import net.i2p.router.TunnelPoolSettings;
|
||||
import net.i2p.router.networkdb.kademlia.FloodfillNetworkDatabaseFacade;
|
||||
import net.i2p.router.transport.ntcp.NTCPAddress;
|
||||
import net.i2p.router.transport.TransportUtil;
|
||||
import net.i2p.stat.Rate;
|
||||
import net.i2p.stat.RateStat;
|
||||
import net.i2p.util.PortMapper;
|
||||
@ -159,7 +159,8 @@ public class SummaryHelper extends HelperBase {
|
||||
switch (status) {
|
||||
case CommSystemFacade.STATUS_OK:
|
||||
RouterAddress ra = routerInfo.getTargetAddress("NTCP");
|
||||
if (ra == null || (new NTCPAddress(ra)).isPubliclyRoutable())
|
||||
// TODO set IPv6 arg based on configuration?
|
||||
if (ra == null || TransportUtil.isPubliclyRoutable(ra.getIP(), true))
|
||||
return _("OK");
|
||||
return _("ERR-Private TCP Address");
|
||||
case CommSystemFacade.STATUS_DIFFERENT:
|
||||
|
Reference in New Issue
Block a user