From 15898a341f036322aa7f66027fd285066a1278d8 Mon Sep 17 00:00:00 2001 From: Nick Brown Date: Thu, 3 Mar 2022 12:52:35 -0800 Subject: [PATCH] Move erroneously placed comment in UDP endpoint PiperOrigin-RevId: 432261816 --- pkg/tcpip/transport/udp/endpoint.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/tcpip/transport/udp/endpoint.go b/pkg/tcpip/transport/udp/endpoint.go index 07e13e970..19fc8c12f 100644 --- a/pkg/tcpip/transport/udp/endpoint.go +++ b/pkg/tcpip/transport/udp/endpoint.go @@ -922,7 +922,7 @@ func (e *endpoint) HandlePacket(id stack.TransportEndpointID, pkt *stack.PacketB e.stats.PacketsReceived.Increment() e.rcvMu.Lock() - // Drop the packet if our buffer is currently full. + // Drop the packet if our buffer is not ready to receive packets. if !e.rcvReady || e.rcvClosed { e.rcvMu.Unlock() e.stack.Stats().UDP.ReceiveBufferErrors.Increment() @@ -931,6 +931,7 @@ func (e *endpoint) HandlePacket(id stack.TransportEndpointID, pkt *stack.PacketB } rcvBufSize := e.ops.GetReceiveBufferSize() + // Drop the packet if our buffer is currently full. if e.frozen || e.rcvBufSize >= int(rcvBufSize) { e.rcvMu.Unlock() e.stack.Stats().UDP.ReceiveBufferErrors.Increment()