From 343fec2383092e9c59f0b0ce410d57350f06cd64 Mon Sep 17 00:00:00 2001 From: Eric Severance Date: Mon, 19 Jan 2026 12:22:32 -0800 Subject: [PATCH] Display traceroutes with 0 hops (#4261) --- .../main/kotlin/org/meshtastic/core/model/RouteDiscovery.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/model/src/main/kotlin/org/meshtastic/core/model/RouteDiscovery.kt b/core/model/src/main/kotlin/org/meshtastic/core/model/RouteDiscovery.kt index e60e85e0d..9d65255af 100644 --- a/core/model/src/main/kotlin/org/meshtastic/core/model/RouteDiscovery.kt +++ b/core/model/src/main/kotlin/org/meshtastic/core/model/RouteDiscovery.kt @@ -39,7 +39,9 @@ val MeshProtos.MeshPacket.fullRouteDiscovery: RouteDiscovery? val fullRouteBack = listOf(sourceId) + routeBackList + destinationId clearRouteBack() - if (hopStart > 0 && snrBackCount > 0) { // otherwise back route is invalid + // hopStart was not populated prior to 2.3.0. The bitfield was added in 2.5.0 and + // is used to detect versions where hopStart can be trusted to have been set. + if ((hopStart > 0 || hasBitfield()) && snrBackCount > 0) { // otherwise back route is invalid addAllRouteBack(fullRouteBack) } }