SSU2: Fix packets exceeding MTU by up to 3 bytes

This commit is contained in:
zzz
2022-08-25 10:58:14 -04:00
parent f4875d12fa
commit b34b0cc399
3 changed files with 10 additions and 4 deletions

View File

@ -1,6 +1,9 @@
2022-08-25 zzz
* Router: Fix deadlock via rebuildRouterAddress() and UDPTransport
* SSU2: Implement path challenge and connection migration
* SSU2:
- Implement path challenge and connection migration
- Fix packets exceeding MTU by up to 3 bytes
- Immediately fail session request containing zero token
2022-08-23 zzz
* Router: Add deadlocks to event log

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Git";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 1;
public final static long BUILD = 2;
/** for example "-test" */
public final static String EXTRA = "";

View File

@ -463,8 +463,11 @@ class OutboundMessageFragments {
if (_log.shouldDebug())
_log.debug("Building packet for " + next + " to " + peer);
int curTotalDataSize = state.fragmentSize(next.num);
if (next.num > 0 && peer.getVersion() > 1)
curTotalDataSize += SSU2Util.DATA_FOLLOWON_EXTRA_SIZE;
if (peer.getVersion() > 1) {
curTotalDataSize += SSU2Util.FIRST_FRAGMENT_HEADER_SIZE;
if (next.num > 0)
curTotalDataSize += SSU2Util.DATA_FOLLOWON_EXTRA_SIZE;
}
// now stuff in more fragments if they fit
if (i +1 < toSend.size()) {
int maxAvail;