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.
pull/424/head
Dionysis Grigoropoulos 2024-01-11 00:03:22 +02:00
rodzic a5783da407
commit 25fa16ed93
Nie znaleziono w bazie danych klucza dla tego podpisu
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -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
"""