1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-09 02:05:59 +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 cc52e39ce4
commit f0bb45e6f4

View file

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