Skip to content

Commit

Permalink
Remove unused gonet.UDPConn.stack field.
Browse files Browse the repository at this point in the history
Fixes #7894

PiperOrigin-RevId: 591533496
  • Loading branch information
ayushr2 authored and gvisor-bot committed Dec 16, 2023
1 parent dc40c49 commit 3406ebb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions pkg/tcpip/adapters/gonet/gonet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/tcpip/adapters/gonet/gonet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3406ebb

Please sign in to comment.