Checksum the header and refuse sequence numbers the sender never sent
This commit is contained in:
+4
-4
@@ -95,19 +95,19 @@ func TestErrsBetweenBuckets(t *testing.T) {
|
||||
n := counterSet{
|
||||
s: sample{
|
||||
lost: 1, late: 7,
|
||||
crcErr: 2, badMagic: 3, badLen: 4,
|
||||
crcErr: 2, badMagic: 3, badLen: 4, badHdr: 10,
|
||||
txErrs: 6, rxErrs: 5,
|
||||
},
|
||||
drops: 9,
|
||||
nic: 8,
|
||||
}
|
||||
got := errsBetween(counterSet{}, n)
|
||||
want := errs{lost: 1, corrupt: 2 + 3 + 4, link: 8 + 5, internal: 9 + 7 + 6}
|
||||
want := errs{lost: 1, corrupt: 2 + 3 + 4 + 10, link: 8 + 5, internal: 9 + 7 + 6}
|
||||
if got != want {
|
||||
t.Errorf("errsBetween = %+v, want %+v", got, want)
|
||||
}
|
||||
if got.total() != 45 {
|
||||
t.Errorf("total = %d, want 45", got.total())
|
||||
if got.total() != 55 {
|
||||
t.Errorf("total = %d, want 55", got.total())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user