Skip to content

Commit

Permalink
Router: Disable updating the PeerManager when we recieve a router dow…
Browse files Browse the repository at this point in the history
…n a client tunnel
  • Loading branch information
eyedeekay committed Dec 20, 2023
1 parent e49c18a commit d5af41d
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,9 @@ public void distribute(I2NPMessage msg, Hash target, TunnelId tunnel) {
return;
if (!ri.isValid())
return;
RouterInfo oldri = _context.netDb().lookupRouterInfoLocally(key);
// only update if RI is newer and non-ff
if (oldri != null && oldri.getPublished() < ri.getPublished() &&
!FloodfillNetworkDatabaseFacade.isFloodfill(ri)) {
if (_log.shouldLog(Log.WARN))
_log.warn("Updating caps for RI " + key + " from \"" +
oldri.getCapabilities() + "\" to \"" + ri.getCapabilities() + '"');
_context.peerManager().setCapabilities(key, ri.getCapabilities());
}
// RouterInfo oldri = _context.netDb().lookupRouterInfoLocally(key);
// don't update caps if the RouterInfo came down a client tunnel, as it may be(Almost certainly is) malicious
// and we deny RI storage in client DB's anyway
return;
} else if (dsm.getReplyToken() != 0) {
_context.statManager().addRateData("tunnel.dropDangerousClientTunnelMessage", 1, type);
Expand Down

0 comments on commit d5af41d

Please sign in to comment.