Skip to content

Commit c86f55c

Browse files
committed
Fix comparisons of seqno in packetmap.
1 parent f3b7326 commit c86f55c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packetmap/packetmap.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ func (m *Map) direct(seqno uint16) (bool, uint16, uint16) {
114114
i := m.lastEntry
115115
for {
116116
f := m.entries[i].first
117-
if seqno >= f {
118-
if seqno < f+m.entries[i].count {
117+
if compare(seqno, f) >= 0 {
118+
if compare(seqno, f+m.entries[i].count) < 0 {
119119
return true,
120120
seqno + m.entries[i].delta,
121121
m.entries[i].pidDelta
@@ -154,8 +154,8 @@ func (m *Map) Reverse(seqno uint16) (bool, uint16, uint16) {
154154
i := m.lastEntry
155155
for {
156156
f := m.entries[i].first + m.entries[i].delta
157-
if seqno >= f {
158-
if seqno < f+m.entries[i].count {
157+
if compare(seqno, f) >= 0 {
158+
if compare(seqno, f+m.entries[i].count) < 0 {
159159
return true,
160160
seqno - m.entries[i].delta,
161161
m.entries[i].pidDelta

0 commit comments

Comments
 (0)