Fixed incorrect resource SDU calculation when link MTU is set

This commit is contained in:
Mark Qvist 2025-01-13 14:42:03 +01:00
parent 63da084bbe
commit 330c2aacac

View File

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