Remove unused gonet.UDPConn.stack field.

Fixes #7894

PiperOrigin-RevId: 591533496
This commit is contained in:
Ayush Ranjan
2023-12-16 09:48:13 -08:00
committed by gVisor bot
parent dc40c49df4
commit 3406ebbb75
2 changed files with 7 additions and 9 deletions
+6 -8
View File
@@ -546,17 +546,15 @@ func DialContextTCP(ctx context.Context, s *stack.Stack, addr tcpip.FullAddress,
type UDPConn struct {
deadlineTimer
stack *stack.Stack
ep tcpip.Endpoint
wq *waiter.Queue
ep tcpip.Endpoint
wq *waiter.Queue
}
// NewUDPConn creates a new UDPConn.
func NewUDPConn(s *stack.Stack, wq *waiter.Queue, ep tcpip.Endpoint) *UDPConn {
func NewUDPConn(wq *waiter.Queue, ep tcpip.Endpoint) *UDPConn {
c := &UDPConn{
stack: s,
ep: ep,
wq: wq,
ep: ep,
wq: wq,
}
c.deadlineTimer.init()
return c
@@ -586,7 +584,7 @@ func DialUDP(s *stack.Stack, laddr, raddr *tcpip.FullAddress, network tcpip.Netw
}
}
c := NewUDPConn(s, &wq, ep)
c := NewUDPConn(&wq, ep)
if raddr != nil {
if err := c.ep.Connect(*raddr); err != nil {
+1 -1
View File
@@ -489,7 +489,7 @@ func TestUDPForwarder(t *testing.T) {
}
defer ep.Close()
c := NewUDPConn(s, &wq, ep)
c := NewUDPConn(&wq, ep)
buf := make([]byte, 256)
n, e := c.Read(buf)