mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-01-18 16:30:33 +00:00
Added link MTU discovery configuration option
This commit is contained in:
parent
89d5d9517d
commit
c6576d6504
@ -245,7 +245,7 @@ class Link:
|
||||
if self.initiator:
|
||||
link_mtu = b""
|
||||
nh_hw_mtu = RNS.Transport.next_hop_interface_hw_mtu(destination.hash)
|
||||
if RNS.Reticulum.LINK_MTU_DISCOVERY and nh_hw_mtu:
|
||||
if RNS.Reticulum.link_mtu_discovery() and nh_hw_mtu:
|
||||
link_mtu = Link.mtu_bytes(nh_hw_mtu)
|
||||
RNS.log(f"Signalling link MTU of {RNS.prettysize(nh_hw_mtu)} for link", RNS.LOG_DEBUG) # TODO: Remove debug
|
||||
self.request_data = self.pub_bytes+self.sig_pub_bytes+link_mtu
|
||||
|
@ -235,6 +235,7 @@ class Reticulum:
|
||||
Reticulum.interfacepath = Reticulum.configdir+"/interfaces"
|
||||
|
||||
Reticulum.__transport_enabled = False
|
||||
Reticulum.__link_mtu_discovery = Reticulum.LINK_MTU_DISCOVERY
|
||||
Reticulum.__remote_management_enabled = False
|
||||
Reticulum.__use_implicit_proof = True
|
||||
Reticulum.__allow_probes = False
|
||||
@ -433,6 +434,10 @@ class Reticulum:
|
||||
v = self.config["reticulum"].as_bool(option)
|
||||
if v == True:
|
||||
Reticulum.__transport_enabled = True
|
||||
if option == "link_mtu_discovery":
|
||||
v = self.config["reticulum"].as_bool(option)
|
||||
if v == True:
|
||||
Reticulum.__link_mtu_discovery = True
|
||||
if option == "enable_remote_management":
|
||||
v = self.config["reticulum"].as_bool(option)
|
||||
if v == True:
|
||||
@ -1238,6 +1243,20 @@ class Reticulum:
|
||||
"""
|
||||
return Reticulum.__transport_enabled
|
||||
|
||||
@staticmethod
|
||||
def link_mtu_discovery():
|
||||
"""
|
||||
Returns whether link MTU discovery is enabled for the running
|
||||
instance.
|
||||
|
||||
When link MTU discovery is enabled, Reticulum will
|
||||
automatically upgrade link MTUs to the highest supported
|
||||
value, increasing transfer speed and efficiency.
|
||||
|
||||
:returns: True if link MTU discovery is enabled, False if not.
|
||||
"""
|
||||
return Reticulum.__link_mtu_discovery
|
||||
|
||||
@staticmethod
|
||||
def remote_management_enabled():
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user