diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-08-26 13:00:48 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-08-26 13:00:48 +0000 |
commit | 9aefb5f0ea85a6706f00f0201e8c82f0f394ea69 (patch) | |
tree | 263994f934997cf8fc4f8a6547f64f18a3ba1070 | |
parent | be89a08adb62cd4d73b1dec21e7ed06ac128d366 (diff) | |
parent | 9f3fa7635e63bb18f0023c7ed960405a8ac341c0 (diff) |
Merge release-20210816.0-44-g9f3fa7635 (automated)
-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). |