mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-07-21 05:59:06 -04:00
Fixed link request handling with invalid link mode
This commit is contained in:
parent
eaec9a493b
commit
6f9a9a7ad9
1 changed files with 16 additions and 8 deletions
|
@ -1379,10 +1379,14 @@ class Transport:
|
||||||
new_raw = new_raw[:-RNS.Link.LINK_MTU_SIZE]
|
new_raw = new_raw[:-RNS.Link.LINK_MTU_SIZE]
|
||||||
else:
|
else:
|
||||||
if nh_mtu < path_mtu:
|
if nh_mtu < path_mtu:
|
||||||
|
try:
|
||||||
path_mtu = nh_mtu
|
path_mtu = nh_mtu
|
||||||
clamped_mtu = RNS.Link.signalling_bytes(path_mtu, mode)
|
clamped_mtu = RNS.Link.signalling_bytes(path_mtu, mode)
|
||||||
RNS.log(f"Clamping link MTU to {RNS.prettysize(nh_mtu)}", RNS.LOG_DEBUG) # TODO: Remove debug
|
RNS.log(f"Clamping link MTU to {RNS.prettysize(nh_mtu)}", RNS.LOG_DEBUG) # TODO: Remove debug
|
||||||
new_raw = new_raw[:-RNS.Link.LINK_MTU_SIZE]+clamped_mtu
|
new_raw = new_raw[:-RNS.Link.LINK_MTU_SIZE]+clamped_mtu
|
||||||
|
except Exception as e:
|
||||||
|
RNS.log(f"Dropping link request packet. The contained exception was: {e}", RNS.LOG_WARNING)
|
||||||
|
return
|
||||||
|
|
||||||
# Entry format is
|
# Entry format is
|
||||||
link_entry = [ now, # 0: Timestamp,
|
link_entry = [ now, # 0: Timestamp,
|
||||||
|
@ -1847,10 +1851,14 @@ class Transport:
|
||||||
packet.data = packet.data[:-RNS.Link.LINK_MTU_SIZE]
|
packet.data = packet.data[:-RNS.Link.LINK_MTU_SIZE]
|
||||||
else:
|
else:
|
||||||
if nh_mtu < path_mtu:
|
if nh_mtu < path_mtu:
|
||||||
|
try:
|
||||||
path_mtu = nh_mtu
|
path_mtu = nh_mtu
|
||||||
clamped_mtu = RNS.Link.signalling_bytes(path_mtu, mode)
|
clamped_mtu = RNS.Link.signalling_bytes(path_mtu, mode)
|
||||||
RNS.log(f"Clamping link MTU to {RNS.prettysize(nh_mtu)}", RNS.LOG_DEBUG) # TODO: Remove debug
|
RNS.log(f"Clamping link MTU to {RNS.prettysize(nh_mtu)}", RNS.LOG_DEBUG) # TODO: Remove debug
|
||||||
packet.data = packet.data[:-RNS.Link.LINK_MTU_SIZE]+clamped_mtu
|
packet.data = packet.data[:-RNS.Link.LINK_MTU_SIZE]+clamped_mtu
|
||||||
|
except Exception as e:
|
||||||
|
RNS.log(f"Dropping link request packet to local destination. The contained exception was: {e}", RNS.LOG_WARNING)
|
||||||
|
return
|
||||||
|
|
||||||
packet.destination = destination
|
packet.destination = destination
|
||||||
destination.receive(packet)
|
destination.receive(packet)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue