Changeset 611ff635


Ignore:
Timestamp:
Apr 27, 2014 3:01:01 PM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
aa0616d
Parents:
91d7a0a
Message:
  • NTCP: Remove published NTCP address if SSU becomes firewalled,

to fix the "Firewalled with NTCP enabled" message

Location:
router/java/src/net/i2p/router/transport
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java

    r91d7a0a r611ff635  
    203203    @Override
    204204    public void notifyReplaceAddress(RouterAddress udpAddr) {
    205         byte[] ip = udpAddr != null ? udpAddr.getIP() : null;
    206         int port = udpAddr != null ? udpAddr.getPort() : 0;
     205        byte[] ip = null;
     206        int port = 0;
     207        // Don't pass IP along if address has introducers
     208        // Right now we publish the direct UDP address, even if publishing introducers,
     209        // we probably shouldn't, see UDPTransport rebuildExternalAddress() TODO
     210        if (udpAddr != null && udpAddr.getOption("ihost0") == null) {
     211            ip = udpAddr.getIP();
     212            port = udpAddr.getPort();
     213        }
    207214        if (port < 0) {
    208215            Transport udp = _manager.getTransport(UDPTransport.STYLE);
  • router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java

    r91d7a0a r611ff635  
    579579     *  Doesn't actually restart unless addr is non-null and
    580580     *  the port is different from the current listen port.
     581     *  If addr is null, removes all addresses.
    581582     *
    582583     *  If we had interface addresses before, we lost them.
     
    592593                replaceAddress(addr);
    593594            // UDPTransport.rebuildExternalAddress() calls router.rebuildRouterInfo()
     595        } else {
     596            replaceAddress(null);
    594597        }
    595598    }
     
    943946        }
    944947        if (_log.shouldLog(Log.INFO))
    945             _log.info("old: " + oport + " config: " + cport + " new: " + nport);
    946         if (nport == null || nport.length() <= 0)
    947             return;
     948            _log.info("old port: " + oport + " config: " + cport + " new: " + nport);
     949        //if (nport == null || nport.length() <= 0)
     950        //    return;
    948951        // 0.9.6 change
    949952        // Don't have NTCP "chase" SSU's external port,
    950953        // as it may change, possibly frequently.
    951954        //if (oport == null || ! oport.equals(nport)) {
    952         if (oport == null) {
     955        if (oport == null && nport != null && nport.length() > 0) {
    953956            newProps.setProperty(RouterAddress.PROP_PORT, nport);
    954957            changed = true;
     
    994997            // otherwise createNTCPAddress() would have done it already
    995998            if (_log.shouldLog(Log.INFO))
    996                 _log.info("old: " + ohost + " config: " + name + " new: " + name);
     999                _log.info("old host: " + ohost + " config: " + name + " new: " + name);
    9971000            newProps.setProperty(RouterAddress.PROP_HOST, name);
    9981001            changed = true;
     
    10051008            // we are still firewalled (SW firewall, bad UPnP indication, etc.)
    10061009            if (_log.shouldLog(Log.INFO))
    1007                 _log.info("old: " + ohost + " config: " + name + " new: null");
     1010                _log.info("old host: " + ohost + " config: " + name + " new: null");
    10081011            newAddr = null;
    10091012            changed = true;
Note: See TracChangeset for help on using the changeset viewer.