Fixed missing announce on fast roam

This commit is contained in:
Mark Qvist 2023-12-05 23:56:45 +01:00
parent 1375f4028e
commit 419ff759e8

View File

@ -2408,6 +2408,7 @@ class SidebandCore():
while True: while True:
time.sleep(SidebandCore.SERVICE_JOB_INTERVAL) time.sleep(SidebandCore.SERVICE_JOB_INTERVAL)
now = time.time() now = time.time()
needs_if_change_announce = False
try: try:
if hasattr(self, "interface_local"): if hasattr(self, "interface_local"):
@ -2417,6 +2418,8 @@ class SidebandCore():
self.owner_service.take_locks(force_multicast=True) self.owner_service.take_locks(force_multicast=True)
self.interface_local.carrier_changed = False self.interface_local.carrier_changed = False
last_multicast_lock_check = now last_multicast_lock_check = now
needs_if_change_announce = True
self.last_if_change_announce = 0
if (self.interface_local != None and len(self.interface_local.adopted_interfaces) == 0) or (self.config["connect_local"] and self.interface_local == None): if (self.interface_local != None and len(self.interface_local.adopted_interfaces) == 0) or (self.config["connect_local"] and self.interface_local == None):
if not self.interface_local_adding: if not self.interface_local_adding:
@ -2428,6 +2431,9 @@ class SidebandCore():
self.interface_local_adding = True self.interface_local_adding = True
def job(): def job():
self.__add_localinterface(delay=60) self.__add_localinterface(delay=60)
if self.config["start_announce"] == True:
time.sleep(12)
self.lxmf_announce(attached_interface=self.interface_local)
threading.Thread(target=job, daemon=True).start() threading.Thread(target=job, daemon=True).start()
if (now - last_multicast_lock_check > 120): if (now - last_multicast_lock_check > 120):
@ -2448,8 +2454,6 @@ class SidebandCore():
# renamed to "auto_announce", which is its current # renamed to "auto_announce", which is its current
# meaning. # meaning.
if self.config["start_announce"] == True: if self.config["start_announce"] == True:
needs_if_change_announce = False
if hasattr(self, "interface_local") and self.interface_local != None: if hasattr(self, "interface_local") and self.interface_local != None:
have_peers = len(self.interface_local.peers) > 0 have_peers = len(self.interface_local.peers) > 0