overflow handling

This commit is contained in:
2022-11-21 10:56:43 +01:00
parent 6b93a9fce1
commit e06cadd088
2 changed files with 15 additions and 0 deletions

View File

@ -25,6 +25,10 @@ impl SequenceCountProvider<u16> for SimpleSeqCountProvider {
}
fn increment(&mut self) {
if self.seq_count == u16::MAX {
self.seq_count = 0;
return;
}
self.seq_count += 1;
}
}