From 25fa16ed937adab53d67fc1d258c14ecfe384c9d Mon Sep 17 00:00:00 2001 From: Dionysis Grigoropoulos Date: Thu, 11 Jan 2024 00:03:22 +0200 Subject: [PATCH] link: Fix MDU calculation size for Links We need to substract the HEADER_MAXSIZE instead of MINSIZE to correctly calculate the MDU of a Link. In order to avoid similar mistakes in the future and not duplicate this calculation, we can reuse Reticulum.MDU instead. --- RNS/Link.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RNS/Link.py b/RNS/Link.py index 24d8c4d..3c6be2c 100644 --- a/RNS/Link.py +++ b/RNS/Link.py @@ -61,7 +61,7 @@ class Link: ECPUBSIZE = 32+32 KEYSIZE = 32 - MDU = math.floor((RNS.Reticulum.MTU-RNS.Reticulum.IFAC_MIN_SIZE-RNS.Reticulum.HEADER_MINSIZE-RNS.Identity.FERNET_OVERHEAD)/RNS.Identity.AES128_BLOCKSIZE)*RNS.Identity.AES128_BLOCKSIZE - 1 + MDU = math.floor((RNS.Reticulum.MDU-RNS.Identity.FERNET_OVERHEAD)/RNS.Identity.AES128_BLOCKSIZE)*RNS.Identity.AES128_BLOCKSIZE - 1 ESTABLISHMENT_TIMEOUT_PER_HOP = RNS.Reticulum.DEFAULT_PER_HOP_TIMEOUT """