diff --git a/RNS/Interfaces/AutoInterface.py b/RNS/Interfaces/AutoInterface.py index c20d553..7d62f13 100644 --- a/RNS/Interfaces/AutoInterface.py +++ b/RNS/Interfaces/AutoInterface.py @@ -33,6 +33,9 @@ import RNS class AutoInterface(Interface): + HW_MTU = 1196 + FIXED_MTU = True + DEFAULT_DISCOVERY_PORT = 29716 DEFAULT_DATA_PORT = 42671 DEFAULT_GROUP_ID = "reticulum".encode("utf-8") @@ -103,8 +106,7 @@ class AutoInterface(Interface): super().__init__() self.netinfo = niwrapper - self.HW_MTU = 1064 - + self.HW_MTU = AutoInterface.HW_MTU self.IN = True self.OUT = False self.name = name diff --git a/RNS/Interfaces/Interface.py b/RNS/Interfaces/Interface.py index 57bc989..ccf92b8 100755 --- a/RNS/Interfaces/Interface.py +++ b/RNS/Interfaces/Interface.py @@ -65,6 +65,7 @@ class Interface: IC_HELD_RELEASE_INTERVAL = 30 AUTOCONFIGURE_MTU = False + FIXED_MTU = False def __init__(self): self.rxb = 0 diff --git a/RNS/Resource.py b/RNS/Resource.py index f66b634..afff68c 100644 --- a/RNS/Resource.py +++ b/RNS/Resource.py @@ -185,7 +185,7 @@ class Resource: resource.window_min = Resource.WINDOW_MIN resource.window_flexibility = Resource.WINDOW_FLEXIBILITY resource.last_activity = time.time() - resource.started_transferring = self.last_activity + resource.started_transferring = resource.last_activity resource.storagepath = RNS.Reticulum.resourcepath+"/"+resource.original_hash.hex() resource.segment_index = adv.i diff --git a/RNS/Reticulum.py b/RNS/Reticulum.py index 0b6d9f9..1ff7562 100755 --- a/RNS/Reticulum.py +++ b/RNS/Reticulum.py @@ -90,7 +90,7 @@ class Reticulum: the default value. """ - LINK_MTU_DISCOVERY = True + LINK_MTU_DISCOVERY = False """ Whether automatic link MTU discovery is enabled by default in this release. Link MTU discovery significantly increases throughput over diff --git a/RNS/Transport.py b/RNS/Transport.py index fcff7a1..8954a84 100755 --- a/RNS/Transport.py +++ b/RNS/Transport.py @@ -1336,7 +1336,7 @@ class Transport: RNS.log(f"No next-hop HW MTU, disabling link MTU upgrade", RNS.LOG_DEBUG) # TODO: Remove debug path_mtu = None new_raw = new_raw[:-RNS.Link.LINK_MTU_SIZE] - elif not outbound_interface.AUTOCONFIGURE_MTU: + elif not outbound_interface.AUTOCONFIGURE_MTU and not outbound_interface.FIXED_MTU: RNS.log(f"Outbound interface doesn't support MTU autoconfiguration, disabling link MTU upgrade", RNS.LOG_DEBUG) # TODO: Remove debug path_mtu = None new_raw = new_raw[:-RNS.Link.LINK_MTU_SIZE] @@ -1799,7 +1799,7 @@ class Transport: for destination in Transport.destinations: if destination.hash == packet.destination_hash and destination.type == packet.destination_type: path_mtu = RNS.Link.mtu_from_lr_packet(packet) - if packet.receiving_interface.AUTOCONFIGURE_MTU: + if packet.receiving_interface.AUTOCONFIGURE_MTU or packet.receiving_interface.FIXED_MTU: nh_mtu = packet.receiving_interface.HW_MTU else: nh_mtu = RNS.Reticulum.MTU @@ -2280,7 +2280,7 @@ class Transport: def next_hop_interface_hw_mtu(destination_hash): next_hop_interface = Transport.next_hop_interface(destination_hash) if next_hop_interface != None: - if next_hop_interface.AUTOCONFIGURE_MTU: + if next_hop_interface.AUTOCONFIGURE_MTU or next_hop_interface.FIXED_MTU: return next_hop_interface.HW_MTU else: return None