We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d494889 commit e54fc56Copy full SHA for e54fc56
pkg/loadbalancer/tunnel.go
@@ -211,7 +211,7 @@ func (t *tunnel) handleUDPConnection(conn *net.UDPConn) error {
211
}
212
defer remoteConn.Close()
213
214
- nWrite, err := remoteConn.Write(buf)
+ nWrite, err := remoteConn.Write(buf[:nRead])
215
if err != nil {
216
return fmt.Errorf("fail to write to remote %s: %s", remoteConn.RemoteAddr(), err)
217
} else if nWrite < nRead {
@@ -230,7 +230,7 @@ func (t *tunnel) handleUDPConnection(conn *net.UDPConn) error {
230
231
klog.V(4).Infof("Read %d bytes from %s", nRead, remoteConn.RemoteAddr().String())
232
233
- _, err = conn.WriteToUDP(buf, srcAddr)
+ _, err = conn.WriteToUDP(buf[:nRead], srcAddr)
234
235
return err
236
0 commit comments