From 29061318dad231cca7bf4be47716277cd6e3903f Mon Sep 17 00:00:00 2001 From: Kleissner Date: Thu, 4 Nov 2021 14:09:48 +0100 Subject: [PATCH] UDT: Fix bug in packet.Add --- udt/packet/pktseq.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/udt/packet/pktseq.go b/udt/packet/pktseq.go index 7d1e334..03a1b9f 100644 --- a/udt/packet/pktseq.go +++ b/udt/packet/pktseq.go @@ -17,8 +17,7 @@ func (p *PacketID) Decr() { // Add returns a packet ID after adding the specified offset func (p PacketID) Add(off int32) PacketID { - newSeq := (p.Seq + 1) & 0x7FFFFFFF - return PacketID{newSeq} + return PacketID{uint32((int32(p.Seq) + off)) & 0x7FFFFFFF} } // BlindDiff attempts to return the difference after subtracting the argument from itself