From f12836d31baa4387b8d9c198c53cb80d478284ca Mon Sep 17 00:00:00 2001 From: zigpy-review-bot <286747149+zigpy-review-bot@users.noreply.github.com> Date: Mon, 23 Nov 2026 02:58:22 +0100 Subject: [PATCH] Gate every early link status for a new router on its tunable `hack_early_link_status_for_unknown_routers` was checked only when a link status made its sender newly listed. The receive path asks for the same early link status when the first frame of any kind arrives from a router whose entry has no LQI sample yet (a restored router child, a router child that just joined), and that path ignored the tunable. With the tunable cleared, a restarted coordinator still sent early link statuses as its restored router children were heard, which its doc says it does not. Check the tunable in `request_link_status_for_new_router`, which both paths go through. The answer to an empty link status list stays independent of it. --- crates/ziggurat-driver/src/zigbee_stack/neighbor.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/crates/ziggurat-driver/src/zigbee_stack/neighbor.rs b/crates/ziggurat-driver/src/zigbee_stack/neighbor.rs index a1b5d0c6..e5acc1b4 100644 --- a/crates/ziggurat-driver/src/zigbee_stack/neighbor.rs +++ b/crates/ziggurat-driver/src/zigbee_stack/neighbor.rs @@ -27,8 +27,13 @@ impl ZigbeeStack { } /// Send the next link status soon: a router it will newly list waits for it to - /// learn its cost. + /// learn its cost. Both callers go through here, so clearing + /// `hack_early_link_status_for_unknown_routers` turns every such request off. fn request_link_status_for_new_router(&self) { + if !self.tunables.hack_early_link_status_for_unknown_routers() { + return; + } + // Coordinator only. Routers must not run this as it is: every router that // hears a new neighbor would send within the same half second, each with its // whole list, and most of those frames would collide. @@ -142,9 +147,7 @@ impl ZigbeeStack { if outcome.link_status_answer_due { self.request_early_link_status(); - } else if outcome.link_status_due - && self.tunables.hack_early_link_status_for_unknown_routers() - { + } else if outcome.link_status_due { self.request_link_status_for_new_router(); }