Author: toad
Date: 2007-12-14 15:24:46 +0000 (Fri, 14 Dec 2007)
New Revision: 16543
Modified:
trunk/freenet/src/freenet/node/FNPPacketMangler.java
Log:
Log an error when we send an oversize auth packet.
Modified: trunk/freenet/src/freenet/node/FNPPacketMangler.java
===================================================================
--- trunk/freenet/src/freenet/node/FNPPacketMangler.java 2007-12-14
15:22:35 UTC (rev 16542)
+++ trunk/freenet/src/freenet/node/FNPPacketMangler.java 2007-12-14
15:24:46 UTC (rev 16543)
@@ -1583,7 +1583,11 @@
int paddingLength;
if(prePaddingLength < maxPacketSize) {
paddingLength =
node.fastWeakRandom.nextInt(Math.min(100, maxPacketSize - prePaddingLength));
- } else paddingLength = 0; // Avoid oversize packets if at all
possible, the MTU is an estimate and may be wrong, and fragmented packets are
often dropped by firewalls.
+ } else {
+ paddingLength = 0; // Avoid oversize packets if at all
possible, the MTU is an estimate and may be wrong, and fragmented packets are
often dropped by firewalls.
+ // Tell the devs, this shouldn't happen.
+ Logger.error(this, "Warning: sending oversize auth
packet of "+prePaddingLength+" bytes!");
+ }
if(paddingLength < 0) paddingLength = 0;
byte[] data = new byte[prePaddingLength + paddingLength];
pcfb.reset(iv);