From c34c268a6a2ad5e1b126356133cd2f4c5957942c Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Thu, 22 Dec 2022 18:20:34 +0100 Subject: [PATCH] Added carrier change detection flag to AutoInterface --- RNS/Interfaces/AutoInterface.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RNS/Interfaces/AutoInterface.py b/RNS/Interfaces/AutoInterface.py index 6f4c0df..8dde98b 100644 --- a/RNS/Interfaces/AutoInterface.py +++ b/RNS/Interfaces/AutoInterface.py @@ -78,6 +78,7 @@ class AutoInterface(Interface): self.interface_servers = {} self.multicast_echoes = {} self.timed_out_interfaces = {} + self.carrier_changed = False self.outbound_udp_socket = None @@ -317,10 +318,12 @@ class AutoInterface(Interface): if now - last_multicast_echo > self.multicast_echo_timeout: if ifname in self.timed_out_interfaces and self.timed_out_interfaces[ifname] == False: + self.carrier_changed = True RNS.log("Multicast echo timeout for "+str(ifname)+". Carrier lost.", RNS.LOG_WARNING) self.timed_out_interfaces[ifname] = True else: if ifname in self.timed_out_interfaces and self.timed_out_interfaces[ifname] == True: + self.carrier_changed = True RNS.log(str(self)+" Carrier recovered on "+str(ifname), RNS.LOG_WARNING) self.timed_out_interfaces[ifname] = False