diff options
author | Bhasker Hariharan <bhaskerh@google.com> | 2020-01-27 05:33:03 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-01-27 05:34:34 -0800 |
commit | 6b43cf791a74a746443f70f98d859c1246f87e2a (patch) | |
tree | af4ef0d22e2e32eed3395f7836f18e9dd62c26fc /pkg/tcpip/header/checksum_test.go | |
parent | 68514d4ba3f7c06a89a8d0cd79327ede62dae65b (diff) |
Replace calculateChecksum w/ the unrolled version.
Fixes #1656
PiperOrigin-RevId: 291703760
Diffstat (limited to 'pkg/tcpip/header/checksum_test.go')
-rw-r--r-- | pkg/tcpip/header/checksum_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/tcpip/header/checksum_test.go b/pkg/tcpip/header/checksum_test.go index 2fbd16a65..309403482 100644 --- a/pkg/tcpip/header/checksum_test.go +++ b/pkg/tcpip/header/checksum_test.go @@ -128,8 +128,8 @@ func TestChecksum(t *testing.T) { } for i := range testCases { - testCases[i].csumOrig = header.Checksum(testCases[i].buf, testCases[i].initial) - testCases[i].csumNew = header.UnrolledChecksum(testCases[i].buf, testCases[i].initial) + testCases[i].csumOrig = header.ChecksumOld(testCases[i].buf, testCases[i].initial) + testCases[i].csumNew = header.Checksum(testCases[i].buf, testCases[i].initial) if got, want := testCases[i].csumNew, testCases[i].csumOrig; got != want { t.Fatalf("new checksum for (buf = %x, initial = %d) does not match old got: %d, want: %d", testCases[i].buf, testCases[i].initial, got, want) } @@ -143,8 +143,8 @@ func BenchmarkChecksum(b *testing.B) { fn func([]byte, uint16) uint16 name string }{ + {header.ChecksumOld, fmt.Sprintf("checksum_old")}, {header.Checksum, fmt.Sprintf("checksum")}, - {header.UnrolledChecksum, fmt.Sprintf("unrolled_checksum")}, } for _, csumImpl := range checkSumImpls { |