From ceccf3153b289bf5e937cd2b76bffeece89683a0 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sun, 12 Jan 2025 23:48:21 +0100 Subject: [PATCH] Correct link MDU calculation --- RNS/Link.py | 1 + 1 file changed, 1 insertion(+) diff --git a/RNS/Link.py b/RNS/Link.py index dd6d1e0..12523c4 100644 --- a/RNS/Link.py +++ b/RNS/Link.py @@ -459,6 +459,7 @@ class Link: def update_mdu(self): self.mdu = self.mtu - RNS.Reticulum.HEADER_MAXSIZE - RNS.Reticulum.IFAC_MIN_SIZE + self.mdu = math.floor((self.mtu-RNS.Reticulum.IFAC_MIN_SIZE-RNS.Reticulum.HEADER_MINSIZE-RNS.Identity.TOKEN_OVERHEAD)/RNS.Identity.AES128_BLOCKSIZE)*RNS.Identity.AES128_BLOCKSIZE - 1 RNS.log(f"Link MDU updated to {self.mdu}", RNS.LOG_DEBUG) # TODO: Remove debug def rtt_packet(self, packet):