From 9c9f0a20f9a358adaeb38ffb2ff91f285e199c76 Mon Sep 17 00:00:00 2001 From: Aaron Heise <5148966+acehoss@users.noreply.github.com> Date: Sat, 4 Mar 2023 23:54:07 -0600 Subject: [PATCH] Handle sequence overflow when checking incoming message --- RNS/Channel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RNS/Channel.py b/RNS/Channel.py index c0f5442..f76fadd 100644 --- a/RNS/Channel.py +++ b/RNS/Channel.py @@ -357,7 +357,7 @@ class Channel(contextlib.AbstractContextManager): with self._lock: message = envelope.unpack(self._message_factories) prev_env = self._rx_ring[0] if len(self._rx_ring) > 0 else None - if prev_env and envelope.sequence != prev_env.sequence + 1: + if prev_env and envelope.sequence != (prev_env.sequence + 1) % 0x10000: RNS.log("Channel: Out of order packet received", RNS.LOG_DEBUG) return is_new = self._emplace_envelope(envelope, self._rx_ring)