From 84b38f4c6e065d3f9314a8abbb3f5857ed4fa44e Mon Sep 17 00:00:00 2001 From: Lucas Manning Date: Mon, 8 Nov 2021 13:26:02 -0800 Subject: Add reference counting to packet buffers. PiperOrigin-RevId: 408426639 --- pkg/tcpip/link/qdisc/fifo/endpoint.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'pkg/tcpip/link/qdisc/fifo/endpoint.go') diff --git a/pkg/tcpip/link/qdisc/fifo/endpoint.go b/pkg/tcpip/link/qdisc/fifo/endpoint.go index c15cbf81b..a68b274b2 100644 --- a/pkg/tcpip/link/qdisc/fifo/endpoint.go +++ b/pkg/tcpip/link/qdisc/fifo/endpoint.go @@ -94,9 +94,7 @@ func (q *queueDispatcher) dispatchLoop() { // We pass a protocol of zero here because each packet carries its // NetworkProtocol. q.lower.WritePackets(stack.RouteInfo{}, batch, 0 /* protocol */) - for pkt := batch.Front(); pkt != nil; pkt = pkt.Next() { - batch.Remove(pkt) - } + batch.DecRef() batch.Reset() } } -- cgit v1.2.3