summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/adapters/gonet/gonet.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/tcpip/adapters/gonet/gonet.go')
-rw-r--r--pkg/tcpip/adapters/gonet/gonet.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/pkg/tcpip/adapters/gonet/gonet.go b/pkg/tcpip/adapters/gonet/gonet.go
index 19491fb2c..490b9c648 100644
--- a/pkg/tcpip/adapters/gonet/gonet.go
+++ b/pkg/tcpip/adapters/gonet/gonet.go
@@ -350,8 +350,7 @@ func (c *Conn) Write(b []byte) (int, error) {
default:
}
- v := buffer.NewView(len(b))
- copy(v, b)
+ v := buffer.NewViewFromBytes(b)
// We must handle two soft failure conditions simultaneously:
// 1. Write may write nothing and return tcpip.ErrWouldBlock.