Fixed incorrect behaviour in announce processing for instance-local destinations to roaming- or boundary-mode interfaces

This commit is contained in:
Mark Qvist 2022-10-18 18:24:29 +02:00
parent 9c8c143c62
commit 5b1b18e84a
1 changed files with 31 additions and 21 deletions

View File

@ -618,6 +618,11 @@ class Transport:
should_transmit = False should_transmit = False
elif interface.mode == RNS.Interfaces.Interface.Interface.MODE_ROAMING: elif interface.mode == RNS.Interfaces.Interface.Interface.MODE_ROAMING:
local_destination = next((d for d in Transport.destinations if d.hash == packet.destination_hash), None)
if local_destination != None:
# RNS.log("Allowing announce broadcast on roaming-mode interface from instance-local destination", RNS.LOG_EXTREME)
pass
else:
from_interface = Transport.next_hop_interface(packet.destination_hash) from_interface = Transport.next_hop_interface(packet.destination_hash)
if from_interface == None or not hasattr(from_interface, "mode"): if from_interface == None or not hasattr(from_interface, "mode"):
should_transmit = False should_transmit = False
@ -634,6 +639,11 @@ class Transport:
should_transmit = False should_transmit = False
elif interface.mode == RNS.Interfaces.Interface.Interface.MODE_BOUNDARY: elif interface.mode == RNS.Interfaces.Interface.Interface.MODE_BOUNDARY:
local_destination = next((d for d in Transport.destinations if d.hash == packet.destination_hash), None)
if local_destination != None:
# RNS.log("Allowing announce broadcast on boundary-mode interface from instance-local destination", RNS.LOG_EXTREME)
pass
else:
from_interface = Transport.next_hop_interface(packet.destination_hash) from_interface = Transport.next_hop_interface(packet.destination_hash)
if from_interface == None or not hasattr(from_interface, "mode"): if from_interface == None or not hasattr(from_interface, "mode"):
should_transmit = False should_transmit = False