diff --git a/pkg/buffer/bucket.go b/pkg/buffer/bucket.go index 9af5ba7ab..ed3fd2d1d 100644 --- a/pkg/buffer/bucket.go +++ b/pkg/buffer/bucket.go @@ -45,7 +45,7 @@ func (b *Bucket) addPacket(pkt []byte, sn uint16, latest bool) []byte { if b.nacker != nil { b.nacker.push(sn - i) } - if b.step > b.maxSteps { + if b.step >= b.maxSteps { b.step = 0 } } @@ -79,7 +79,7 @@ func (b *Bucket) push(pkt []byte) []byte { off := b.step*maxPktSize + 2 copy(b.buf[off:], pkt) b.step++ - if b.step > b.maxSteps { + if b.step >= b.maxSteps { b.step = 0 } return b.buf[off : off+len(pkt)]