From fe4870199ecc9e550b9a26e0d5483fc42f3f9d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= Date: Thu, 12 Oct 2023 17:44:50 +0100 Subject: [PATCH] use saturating sub in case outfox is not enabled --- common/client-libs/gateway-client/src/traits.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/client-libs/gateway-client/src/traits.rs b/common/client-libs/gateway-client/src/traits.rs index 54b53ffc814..cb0a3f4d221 100644 --- a/common/client-libs/gateway-client/src/traits.rs +++ b/common/client-libs/gateway-client/src/traits.rs @@ -42,7 +42,9 @@ pub trait GatewayPacketRouter { } n if n - == PacketSize::OutfoxRegularPacket.plaintext_size() - outfox_ack_overhead => + == PacketSize::OutfoxRegularPacket + .plaintext_size() + .saturating_sub(outfox_ack_overhead) => { trace!("received regular outfox packet"); received_messages.push(received_packet);