From 7ed968551eab2f54dfb5ca0d995e2679ed1a9fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Narajowski?= Date: Tue, 20 Feb 2018 14:25:30 +0100 Subject: [PATCH] mesh: Ignore segments of cancelled message This fixes the issue when after incomplete timer expiration host sent ACK. The host failed in two cases: 1. Sending ACK right after the incomplete timer expiration; 2. Sending ACK from new RX context. Now, seq_auth of cancelled message is not cleaned on RX reset, so segments of cancelled message will be discarded when resend. According to the Mesh Profile v1.0 "When the incomplete timer expires, the lower transport layer shall consider that the message being received has failed and cancel the acknowledgment timer. Any segment of a canceled message shall be ignored." X-Original-Commit: 50e7d632932c4188849aee89e0d23e2207352601 --- nimble/host/mesh/src/transport.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nimble/host/mesh/src/transport.c b/nimble/host/mesh/src/transport.c index 4ae20f37b..918af1fe7 100644 --- a/nimble/host/mesh/src/transport.c +++ b/nimble/host/mesh/src/transport.c @@ -1009,9 +1009,7 @@ static void seg_ack(struct os_event *work) if (k_uptime_get_32() - rx->last > K_SECONDS(60)) { BT_WARN("Incomplete timer expired"); - send_ack(rx->sub, rx->dst, rx->src, rx->ttl, - &rx->seq_auth, 0, rx->obo); - seg_rx_reset(rx, true); + seg_rx_reset(rx, false); if (IS_ENABLED(CONFIG_BT_TESTING)) { bt_test_mesh_trans_incomp_timer_exp();