From bdeeae9c047f47a63ffcc3714533fb2438ae4f0d Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Wed, 31 Mar 2021 12:45:26 +0100 Subject: [PATCH] net.c: Handle duplicate empty ACK An empty response ACK is ignored if there was a request on the Send-Q. However if there was a subsequent duplicate ACK this would then fall through to the general handling logic in coap_dispatch(), and would trigger the ping handler (if set) and send a RST (if not mcast) which is not correct. Correct a change added in by #554 so that all empty response ACKs are ignored. --- src/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net.c b/src/net.c index a02328ae..54104ca5 100644 --- a/src/net.c +++ b/src/net.c @@ -2926,7 +2926,7 @@ coap_dispatch(coap_context_t *context, coap_session_t *session, coap_touch_observer(context, sent->session, &token); } - if (pdu->code == 0 && sent) { + if (pdu->code == 0) { /* an empty ACK needs no further handling */ goto cleanup; }