From 9c8c143c62fdc9967f6c63d13ed1d4c28783fc12 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Tue, 18 Oct 2022 17:44:14 +0200 Subject: [PATCH] Added logging to announce processing --- RNS/Transport.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/RNS/Transport.py b/RNS/Transport.py index 96368b8..ad4cb82 100755 --- a/RNS/Transport.py +++ b/RNS/Transport.py @@ -620,8 +620,11 @@ class Transport: elif interface.mode == RNS.Interfaces.Interface.Interface.MODE_ROAMING: from_interface = Transport.next_hop_interface(packet.destination_hash) if from_interface == None or not hasattr(from_interface, "mode"): - RNS.log("Blocking announce broadcast on "+str(interface)+" since next hop interface is non-existing or has no mode configured", RNS.LOG_EXTREME) should_transmit = False + if from_interface == None: + RNS.log("Blocking announce broadcast on "+str(interface)+" since next hop interface doesn't exist", RNS.LOG_EXTREME) + elif not hasattr(from_interface, "mode"): + RNS.log("Blocking announce broadcast on "+str(interface)+" since next hop interface has no mode configured", RNS.LOG_EXTREME) else: if from_interface.mode == RNS.Interfaces.Interface.Interface.MODE_ROAMING: RNS.log("Blocking announce broadcast on "+str(interface)+" due to roaming-mode next-hop interface", RNS.LOG_EXTREME) @@ -633,8 +636,11 @@ class Transport: elif interface.mode == RNS.Interfaces.Interface.Interface.MODE_BOUNDARY: from_interface = Transport.next_hop_interface(packet.destination_hash) if from_interface == None or not hasattr(from_interface, "mode"): - RNS.log("Blocking announce broadcast on "+str(interface)+" since next hop interface is non-existing or has no mode configured", RNS.LOG_EXTREME) should_transmit = False + if from_interface == None: + RNS.log("Blocking announce broadcast on "+str(interface)+" since next hop interface doesn't exist", RNS.LOG_EXTREME) + elif not hasattr(from_interface, "mode"): + RNS.log("Blocking announce broadcast on "+str(interface)+" since next hop interface has no mode configured", RNS.LOG_EXTREME) else: if from_interface.mode == RNS.Interfaces.Interface.Interface.MODE_ROAMING: RNS.log("Blocking announce broadcast on "+str(interface)+" due to roaming-mode next-hop interface", RNS.LOG_EXTREME)