Changeset 0570fed


Ignore:
Timestamp:
Apr 1, 2014 1:05:51 PM (7 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
24a133fe
Parents:
b206665
Message:
  • NetDB: Handle RI response from non-floodfill router down a client tunnel
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • history.txt

    rb206665 r0570fed  
     12014-04-01 zzz
     2 * Console: Fix summary bar html when displaying an update constraint
     3 * NetDB: Handle RI response from non-floodfill router down a client tunnel
     4
    15* 2014-03-31 0.9.12 released
    26
  • router/java/src/net/i2p/router/RouterVersion.java

    rb206665 r0570fed  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 0;
     21    public final static long BUILD = 1;
    2222
    2323    /** for example "-test" */
  • router/java/src/net/i2p/router/networkdb/kademlia/IterativeSearchJob.java

    rb206665 r0570fed  
    101101
    102102    /**
    103      *  Lookup using the client's tunnels
     103     *  Lookup using the client's tunnels.
     104     *  Do not use for RI lookups down client tunnels,
     105     *  as the response will be dropped in InboundMessageDistributor.
    104106     *  @param fromLocalDest use these tunnels for the lookup, or null for exploratory
    105107     *  @since 0.9.10
     
    117119        _sentTime = new ConcurrentHashMap<Hash, Long>(TOTAL_SEARCH_LIMIT);
    118120        _fromLocalDest = fromLocalDest;
     121        if (fromLocalDest != null && !isLease && _log.shouldLog(Log.WARN))
     122            _log.warn("Search for RI " + key + " down client tunnel " + fromLocalDest, new Exception());
    119123    }
    120124
  • router/java/src/net/i2p/router/tunnel/InboundMessageDistributor.java

    rb206665 r0570fed  
    55import net.i2p.data.LeaseSet;
    66import net.i2p.data.Payload;
     7import net.i2p.data.RouterInfo;
    78import net.i2p.data.TunnelId;
    89import net.i2p.data.i2np.DataMessage;
     
    1920import net.i2p.router.TunnelInfo;
    2021import net.i2p.router.message.GarlicMessageReceiver;
    21 //import net.i2p.router.networkdb.kademlia.FloodfillNetworkDatabaseFacade;
     22import net.i2p.router.networkdb.kademlia.FloodfillNetworkDatabaseFacade;
    2223import net.i2p.util.Log;
    2324
     
    8384            if (dsm.getEntry().getType() == DatabaseEntry.KEY_TYPE_ROUTERINFO) {
    8485                // FVSJ may result in an unsolicited RI store if the peer went non-ff.
    85                 // Maybe we can figure out a way to handle this safely, so we don't ask him again.
    86                 // For now, just hope we eventually find out through other means.
     86                // We handle this safely, so we don't ask him again.
    8787                // Todo: if peer was ff and RI is not ff, queue for exploration in netdb (but that isn't part of the facade now)
    8888                if (_log.shouldLog(Log.WARN))
    8989                    _log.warn("Dropping DSM down a tunnel for " + _client + ": " + msg);
     90                // Handle safely by just updating the caps table, after doing basic validation
     91                Hash key = dsm.getKey();
     92                if (_context.routerHash().equals(key))
     93                    return;
     94                RouterInfo ri = (RouterInfo) dsm.getEntry();
     95                if (!key.equals(ri.getIdentity().getHash()))
     96                    return;
     97                if (!ri.isValid())
     98                    return;
     99                RouterInfo oldri = _context.netDb().lookupRouterInfoLocally(key);
     100                // only update if RI is newer and non-ff
     101                if (oldri != null && oldri.getPublished() < ri.getPublished() &&
     102                    !FloodfillNetworkDatabaseFacade.isFloodfill(ri)) {
     103                    if (_log.shouldLog(Log.WARN))
     104                        _log.warn("Updating caps for RI " + key + " from \"" +
     105                                  oldri.getCapabilities() + "\" to \"" + ri.getCapabilities() + '"');
     106                    _context.peerManager().setCapabilities(key, ri.getCapabilities());
     107                }
    90108                return;
    91109            } else if (dsm.getReplyToken() != 0) {
Note: See TracChangeset for help on using the changeset viewer.