From 9d148627f82f4325b499e023c5cbf8afd5f988f6 Mon Sep 17 00:00:00 2001 From: Bruno Dal Bo Date: Wed, 18 Nov 2020 07:03:02 -0800 Subject: Introduce stack.WritePacketToRemote, remove LinkEndpoint.WriteRawPacket Redefine stack.WritePacket into stack.WritePacketToRemote which lets the NIC decide whether to append link headers. PiperOrigin-RevId: 343071742 --- pkg/tcpip/link/sharedmem/sharedmem.go | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'pkg/tcpip/link/sharedmem/sharedmem.go') diff --git a/pkg/tcpip/link/sharedmem/sharedmem.go b/pkg/tcpip/link/sharedmem/sharedmem.go index 7fb8a6c49..a1e7018c8 100644 --- a/pkg/tcpip/link/sharedmem/sharedmem.go +++ b/pkg/tcpip/link/sharedmem/sharedmem.go @@ -224,21 +224,6 @@ func (e *endpoint) WritePackets(r *stack.Route, _ *stack.GSO, pkts stack.PacketB panic("not implemented") } -// WriteRawPacket implements stack.LinkEndpoint.WriteRawPacket. -func (e *endpoint) WriteRawPacket(vv buffer.VectorisedView) *tcpip.Error { - views := vv.Views() - // Transmit the packet. - e.mu.Lock() - ok := e.tx.transmit(views...) - e.mu.Unlock() - - if !ok { - return tcpip.ErrWouldBlock - } - - return nil -} - // dispatchLoop reads packets from the rx queue in a loop and dispatches them // to the network stack. func (e *endpoint) dispatchLoop(d stack.NetworkDispatcher) { -- cgit v1.2.3