On Tuesday 22 July 2008 17:52, nextgens at freenetproject.org wrote: > Author: nextgens > Date: 2008-07-22 16:52:25 +0000 (Tue, 22 Jul 2008) > New Revision: 21320 > > Modified: > trunk/freenet/src/freenet/node/NodeDispatcher.java > Log: > Implement the FOAF-attack-mitigation hack
IMHO we should accept the new location but ignore the FOAF locations, no? > > Modified: trunk/freenet/src/freenet/node/NodeDispatcher.java > =================================================================== > --- trunk/freenet/src/freenet/node/NodeDispatcher.java 2008-07-22 > 16:10:35 UTC (rev 21319) > +++ trunk/freenet/src/freenet/node/NodeDispatcher.java 2008-07-22 > 16:52:25 UTC (rev 21320) > @@ -154,8 +154,20 @@ > double newLoc = m.getDouble(DMT.LOCATION); > ShortBuffer buffer = ((ShortBuffer) > m.getObject(DMT.PEER_LOCATIONS)); > double[] locs = Fields.bytesToDoubles(buffer.getData()); > - source.updateLocation(newLoc, locs); > > + /** > + * Do *NOT* remove the sanity check below! > + * @see http://archives.freenetproject.org/message/20080718.144240.359e16d3.en.html > + */ > + if((OpennetManager.MAX_PEERS_FOR_SCALING < locs.length) > && (source.isOpennet())) { > + Logger.error(this, "We received "+locs.length+ > " locations from "+source.toString()+"! That should *NOT* happen!"); > + return true; > + } else { > + // We are on darknet and we trust our peers OR > we are on opennet > + // and the amount of locations sent to us seems > reasonable > + source.updateLocation(newLoc, locs); > + } > + > return true; > } > > > _______________________________________________ > cvs mailing list > cvs at freenetproject.org > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <https://emu.freenetproject.org/pipermail/devl/attachments/20080801/16496ff3/attachment.pgp>
