From 002f1d4aaefa9abdd50e3e8906ae828c31d038e6 Mon Sep 17 00:00:00 2001 From: Ian Gudger Date: Fri, 20 Sep 2019 14:08:46 -0700 Subject: Allow waiting for LinkEndpoint worker goroutines to finish. Previously, the only safe way to use an fdbased endpoint was to leak the FD. This change makes it possible to safely close the FD. This is the first step towards having stoppable stacks. Updates #837 PiperOrigin-RevId: 270346582 --- pkg/tcpip/link/sniffer/sniffer.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkg/tcpip/link/sniffer') diff --git a/pkg/tcpip/link/sniffer/sniffer.go b/pkg/tcpip/link/sniffer/sniffer.go index e7b6d7912..e401dce44 100644 --- a/pkg/tcpip/link/sniffer/sniffer.go +++ b/pkg/tcpip/link/sniffer/sniffer.go @@ -240,6 +240,9 @@ func (e *endpoint) WritePacket(r *stack.Route, gso *stack.GSO, hdr buffer.Prepen return e.lower.WritePacket(r, gso, hdr, payload, protocol) } +// Wait implements stack.LinkEndpoint.Wait. +func (*endpoint) Wait() {} + func logPacket(prefix string, protocol tcpip.NetworkProtocolNumber, b buffer.View, gso *stack.GSO) { // Figure out the network layer info. var transProto uint8 -- cgit v1.2.3