SSU: Fix packet-too-large check in UDPSender

This commit is contained in:
zzz
2022-04-05 07:55:28 -04:00
parent e43810f182
commit 75492514ca

View File

@@ -193,7 +193,8 @@ class UDPSender {
public void add(UDPPacket packet) {
if (packet == null || !_keepRunning) return;
int psz = packet.getPacket().getLength();
if (psz > PeerState2.MAX_MTU) {
// minus IP header and UDP header, assume IPv4, this is just a quick check
if (psz > PeerState2.MAX_MTU - 28) {
_log.error("Dropping large UDP packet " + psz + " bytes: " + packet, new Exception());
return;
}