From 5d8e66180757f9fe2e02cef7ffb37c02edbe31ea Mon Sep 17 00:00:00 2001 From: GUVWAF Date: Sat, 19 Nov 2022 17:18:51 +0100 Subject: [PATCH] Send NAK on primary channel if it cannot decode it --- src/mesh/ReliableRouter.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mesh/ReliableRouter.cpp b/src/mesh/ReliableRouter.cpp index e42f2cdef..2807178b8 100644 --- a/src/mesh/ReliableRouter.cpp +++ b/src/mesh/ReliableRouter.cpp @@ -96,7 +96,11 @@ void ReliableRouter::sniffReceived(const MeshPacket *p, const Routing *c) if (MeshModule::currentReply) DEBUG_MSG("Some other module has replied to this message, no need for a 2nd ack\n"); else - sendAckNak(Routing_Error_NONE, getFrom(p), p->id, p->channel); + if (p->which_payload_variant == MeshPacket_decoded_tag) + sendAckNak(Routing_Error_NONE, getFrom(p), p->id, p->channel); + else + // Send a 'NO_CHANNEL' error on the primary channel if want_ack packet destined for us cannot be decoded + sendAckNak(Routing_Error_NO_CHANNEL, getFrom(p), p->id, channels.getPrimaryIndex()); } // We consider an ack to be either a !routing packet with a request ID or a routing packet with !error