1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-23 00:55:58 +01:00

Don't update packetmap for non-increasing seqnos.

When using an identity packetmap, we used to update the next seqno
even when packets were not increasing.  Not a big deal, we'd still
recover at the next sequential packet.
This commit is contained in:
Juliusz Chroboczek 2022-12-30 19:32:16 +01:00
parent 397892d906
commit e28d6f6de0

View file

@ -30,8 +30,11 @@ func (m *Map) Map(seqno uint16, pid uint16) (bool, uint16, uint16) {
defer m.mu.Unlock() defer m.mu.Unlock()
if m.delta == 0 && m.entries == nil { if m.delta == 0 && m.entries == nil {
m.next = seqno + 1 if compare(m.next, seqno) <= 0 ||
m.nextPid = pid uint16(m.next - seqno) > 8 * 1024 {
m.next = seqno + 1
m.nextPid = pid
}
return true, seqno, 0 return true, seqno, 0
} }