Skip to content

Commit 1d3bdf1

Browse files
authored
Merge pull request #871 from viric/traceroute-0hop
Fix traceroute timeout for case of 0-hops
2 parents d8e438b + 7129a9f commit 1d3bdf1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

meshtastic/mesh_interface.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,8 @@ def sendTraceRoute(
673673
hopLimit=hopLimit,
674674
)
675675
# extend timeout based on number of nodes, limit by configured hopLimit
676-
waitFactor = min(len(self.nodes) - 1 if self.nodes else 0, hopLimit)
676+
nodes_based_factor = (len(self.nodes) - 1) if self.nodes else (hopLimit + 1)
677+
waitFactor = max(1, min(nodes_based_factor, hopLimit + 1))
677678
self.waitForTraceRoute(waitFactor)
678679

679680
def onResponseTraceRoute(self, p: dict):

0 commit comments

Comments
 (0)