mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Avoid unhandled error warnings
PiperOrigin-RevId: 393104589
This commit is contained in:
committed by
gVisor bot
parent
c408789ed4
commit
9f3fa7635e
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user