From 3d4f836c00483dc08d3b34f5c67529f87f60d2b0 Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Tue, 26 Jan 2021 15:12:08 +0100 Subject: [PATCH] Correctly insert out of order msgs to queue --- src/internal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/internal.c b/src/internal.c index 41e1bf4d7..b07f3c614 100644 --- a/src/internal.c +++ b/src/internal.c @@ -7222,8 +7222,8 @@ DtlsMsg* DtlsMsgInsert(DtlsMsg* head, DtlsMsg* item) DtlsMsg* cur = head->next; DtlsMsg* prev = head; while (cur) { - if (item->epoch <= head->epoch && - item->seq < head->seq) { + if (item->epoch <= cur->epoch && + item->seq < cur->seq) { item->next = cur; prev->next = item; break;