From 330c2aacac28b9eb794b8b54a02c619d40219949 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Mon, 13 Jan 2025 14:42:03 +0100 Subject: [PATCH] Fixed incorrect resource SDU calculation when link MTU is set --- RNS/Resource.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/RNS/Resource.py b/RNS/Resource.py index a05e1b3..b0c726a 100644 --- a/RNS/Resource.py +++ b/RNS/Resource.py @@ -276,7 +276,10 @@ class Resource: self.status = Resource.NONE self.link = link - self.sdu = link.mdu or Resource.SDU + if self.link.mtu: + self.sdu = self.link.mtu - RNS.Reticulum.HEADER_MAXSIZE - RNS.Reticulum.IFAC_MIN_SIZE + else: + self.sdu = link.mdu or Resource.SDU self.max_retries = Resource.MAX_RETRIES self.max_adv_retries = Resource.MAX_ADV_RETRIES self.retries_left = self.max_retries