Skip to content

Commit

Permalink
Merge dev branch
Browse files Browse the repository at this point in the history
  • Loading branch information
eyedeekay committed Dec 20, 2023
2 parents d7a7812 + d5af41d commit 27e5721
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public FloodfillNetworkDatabaseFacade(RouterContext context, Hash dbid) {
_ffMonitor = new FloodfillMonitorJob(_context, this);
}

private boolean ignoreFloodfillCapability() {
public boolean ignoreFloodfillCapability() {
return _context.getBooleanProperty(ALWAYS_CONSIDER_PEER_FLOODFILL);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,8 @@ void newPeerToTry(Hash peer) {
}
RouterInfo ri = getContext().netDb().lookupRouterInfoLocally(peer);
if (ri != null && ((FloodfillNetworkDatabaseFacade) getContext().netDb()).isNotFloodfill(ri)) {
if (_log.shouldLog(Log.INFO))
if ((FloodfillNetworkDatabaseFacade) getContext().netDb()).ignoreFloodfillCapability())
if (_log.shouldLog(Log.INFO)))
_log.info(getJobId() + ": non-ff peer from DSRM " + peer);
return;
}
Expand Down
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)_context.netDb()).isNotFloodfill(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 27e5721

Please sign in to comment.