diff options
author | Tamir Duberstein <tamird@google.com> | 2021-08-26 05:52:43 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-08-26 05:55:43 -0700 |
commit | 9f3fa7635e63bb18f0023c7ed960405a8ac341c0 (patch) | |
tree | 1dc6d6f05408f1a46330ab5dfe32b6793afa55ae /pkg | |
parent | c408789ed4380191be8f668469566b2d3bc415c1 (diff) |
Avoid unhandled error warnings
PiperOrigin-RevId: 393104589
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/tcpip/transport/tcp/connect.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/pkg/tcpip/transport/tcp/connect.go b/pkg/tcpip/transport/tcp/connect.go index 116c35325..ac9091d04 100644 --- a/pkg/tcpip/transport/tcp/connect.go +++ b/pkg/tcpip/transport/tcp/connect.go @@ -164,13 +164,16 @@ func (h *handshake) resetState() { // recommendation here https://tools.ietf.org/html/rfc6528#page-3. func generateSecureISN(id stack.TransportEndpointID, clock tcpip.Clock, seed uint32) seqnum.Value { isnHasher := jenkins.Sum32(seed) - isnHasher.Write([]byte(id.LocalAddress)) - isnHasher.Write([]byte(id.RemoteAddress)) + // Per hash.Hash.Writer: + // + // It never returns an error. + _, _ = isnHasher.Write([]byte(id.LocalAddress)) + _, _ = isnHasher.Write([]byte(id.RemoteAddress)) portBuf := make([]byte, 2) binary.LittleEndian.PutUint16(portBuf, id.LocalPort) - isnHasher.Write(portBuf) + _, _ = isnHasher.Write(portBuf) binary.LittleEndian.PutUint16(portBuf, id.RemotePort) - isnHasher.Write(portBuf) + _, _ = isnHasher.Write(portBuf) // The time period here is 64ns. This is similar to what linux uses // generate a sequence number that overlaps less than one // time per MSL (2 minutes). |