* Fix issue 9792, decode packet for TR test * Fix 9792: Assure packet id decoded for TR test * Potential fix for pull request finding Log improvement for failure to decode packet. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * trunk fmt --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Tom Fifield <tom@tomfifield.net>
This commit is contained in:
co-authored by
GitHub
Copilot Autofix powered by AI
Tom Fifield
parent
3604c1255d
commit
eb80d3141d
@@ -91,10 +91,27 @@ void FloodingRouter::reprocessPacket(const meshtastic_MeshPacket *p)
|
|||||||
{
|
{
|
||||||
if (nodeDB)
|
if (nodeDB)
|
||||||
nodeDB->updateFrom(*p);
|
nodeDB->updateFrom(*p);
|
||||||
|
|
||||||
#if !MESHTASTIC_EXCLUDE_TRACEROUTE
|
#if !MESHTASTIC_EXCLUDE_TRACEROUTE
|
||||||
|
if (traceRouteModule && p->which_payload_variant != meshtastic_MeshPacket_decoded_tag) {
|
||||||
|
// If we got a packet that is not decoded, try to decode it so we can check for traceroute.
|
||||||
|
auto decodedState = perhapsDecode(const_cast<meshtastic_MeshPacket *>(p));
|
||||||
|
if (decodedState == DecodeState::DECODE_SUCCESS) {
|
||||||
|
// parsing was successful, print for debugging
|
||||||
|
printPacket("reprocessPacket(DUP)", p);
|
||||||
|
} else {
|
||||||
|
// Fatal decoding error, we can't do anything with this packet
|
||||||
|
LOG_WARN(
|
||||||
|
"FloodingRouter::reprocessPacket: Fatal decode error (state=%d, id=0x%08x, from=%u), can't check for traceroute",
|
||||||
|
static_cast<int>(decodedState), p->id, getFrom(p));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (traceRouteModule && p->which_payload_variant == meshtastic_MeshPacket_decoded_tag &&
|
if (traceRouteModule && p->which_payload_variant == meshtastic_MeshPacket_decoded_tag &&
|
||||||
p->decoded.portnum == meshtastic_PortNum_TRACEROUTE_APP)
|
p->decoded.portnum == meshtastic_PortNum_TRACEROUTE_APP) {
|
||||||
traceRouteModule->processUpgradedPacket(*p);
|
traceRouteModule->processUpgradedPacket(*p);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user