Author: toad
Date: 2007-08-22 19:36:49 +0000 (Wed, 22 Aug 2007)
New Revision: 14838

Modified:
   trunk/freenet/src/freenet/node/LocationManager.java
Log:
Enforce the swap max HTL. Up to now it could have been set to 
Integer.MAX_VALUE. Ouch!

Modified: trunk/freenet/src/freenet/node/LocationManager.java
===================================================================
--- trunk/freenet/src/freenet/node/LocationManager.java 2007-08-22 19:35:22 UTC 
(rev 14837)
+++ trunk/freenet/src/freenet/node/LocationManager.java 2007-08-22 19:36:49 UTC 
(rev 14838)
@@ -740,7 +740,7 @@
             return true;
         }
         if(logMINOR) Logger.minor(this, "SwapRequest from "+pn+" - uid="+uid);
-        int htl = m.getInt(DMT.HTL)-1;
+        int htl = Math.min(m.getInt(DMT.HTL),SWAP_MAX_HTL)-1;
         // Either forward it or handle it
         if(htl == 0) {
                if(logMINOR) Logger.minor(this, "Accepting?... "+uid);


Reply via email to