Merge pull request #871 from viric/traceroute-0hop

Fix traceroute timeout for case of 0-hops
This commit is contained in:
Ian McEwen authored and GitHub committed 2026-03-02 10:05:33 -07:00
commit 1d3bdf143a
1 file changed
+2 -1
+2 -1
View File
@@ -673,7 +673,8 @@ class MeshInterface: # pylint: disable=R0902
hopLimit=hopLimit,
)
# extend timeout based on number of nodes, limit by configured hopLimit
waitFactor = min(len(self.nodes) - 1 if self.nodes else 0, hopLimit)
nodes_based_factor = (len(self.nodes) - 1) if self.nodes else (hopLimit + 1)
waitFactor = max(1, min(nodes_based_factor, hopLimit + 1))
self.waitForTraceRoute(waitFactor)
def onResponseTraceRoute(self, p: dict):