Reprocess repeated packets also

This commit is contained in:
GUVWAF 2025-10-05 14:04:35 +02:00
parent de6a02756d
commit 7c373b76c4
2 changed files with 13 additions and 5 deletions

View File

@ -45,8 +45,10 @@ bool FloodingRouter::shouldFilterReceived(const meshtastic_MeshPacket *p)
if (isRepeated) { if (isRepeated) {
LOG_DEBUG("Repeated reliable tx"); LOG_DEBUG("Repeated reliable tx");
// Check if it's still in the Tx queue, if not, we have to relay it again // Check if it's still in the Tx queue, if not, we have to relay it again
if (!findInTxQueue(p->from, p->id)) if (!findInTxQueue(p->from, p->id)) {
reprocessPacket(p);
perhapsRebroadcast(p); perhapsRebroadcast(p);
}
} else { } else {
perhapsCancelDupe(p); perhapsCancelDupe(p);
} }

View File

@ -59,14 +59,20 @@ bool NextHopRouter::shouldFilterReceived(const meshtastic_MeshPacket *p)
if (wasFallback) { if (wasFallback) {
LOG_INFO("Fallback to flooding from relay_node=0x%x", p->relay_node); LOG_INFO("Fallback to flooding from relay_node=0x%x", p->relay_node);
// Check if it's still in the Tx queue, if not, we have to relay it again // Check if it's still in the Tx queue, if not, we have to relay it again
if (!findInTxQueue(p->from, p->id)) if (!findInTxQueue(p->from, p->id)) {
perhapsRelay(p); reprocessPacket(p);
perhapsRebroadcast(p);
}
} else { } else {
bool isRepeated = p->hop_start > 0 && p->hop_start == p->hop_limit; bool isRepeated = p->hop_start > 0 && p->hop_start == p->hop_limit;
// If repeated and not in Tx queue anymore, try relaying again, or if we are the destination, send the ACK again // If repeated and not in Tx queue anymore, try relaying again, or if we are the destination, send the ACK again
if (isRepeated) { if (isRepeated) {
if (!findInTxQueue(p->from, p->id) && !perhapsRelay(p) && isToUs(p) && p->want_ack) if (!findInTxQueue(p->from, p->id)) {
sendAckNak(meshtastic_Routing_Error_NONE, getFrom(p), p->id, p->channel, 0); reprocessPacket(p);
if (!perhapsRebroadcast(p) && isToUs(p) && p->want_ack) {
sendAckNak(meshtastic_Routing_Error_NONE, getFrom(p), p->id, p->channel, 0);
}
}
} else if (!weWereNextHop) { } else if (!weWereNextHop) {
perhapsCancelDupe(p); // If it's a dupe, cancel relay if we were not explicitly asked to relay perhapsCancelDupe(p); // If it's a dupe, cancel relay if we were not explicitly asked to relay
} }