summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/link/channel
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2019-10-21 20:26:03 +0000
committergVisor bot <gvisor-bot@google.com>2019-10-21 20:26:03 +0000
commit975132cced68da837aea09743d45a103be1789c7 (patch)
treecfb9f8426af5bb021d4d087a2af784d95bd06e89 /pkg/tcpip/link/channel
parent17a63aa1580ad13c7f3c441a414d331f3c6be52f (diff)
parent12235d533ae5c8b4b03c6d7f24cae785a2d6ec22 (diff)
Merge release-20190806.1-295-g12235d5 (automated)
Diffstat (limited to 'pkg/tcpip/link/channel')
-rwxr-xr-xpkg/tcpip/link/channel/channel.go19
1 files changed, 18 insertions, 1 deletions
diff --git a/pkg/tcpip/link/channel/channel.go b/pkg/tcpip/link/channel/channel.go
index 18adb2085..95c6f0828 100755
--- a/pkg/tcpip/link/channel/channel.go
+++ b/pkg/tcpip/link/channel/channel.go
@@ -72,7 +72,7 @@ func (e *Endpoint) Inject(protocol tcpip.NetworkProtocolNumber, vv buffer.Vector
// InjectLinkAddr injects an inbound packet with a remote link address.
func (e *Endpoint) InjectLinkAddr(protocol tcpip.NetworkProtocolNumber, remote tcpip.LinkAddress, vv buffer.VectorisedView) {
- e.dispatcher.DeliverNetworkPacket(e, remote, "" /* local */, protocol, vv.Clone(nil))
+ e.dispatcher.DeliverNetworkPacket(e, remote, "" /* local */, protocol, vv.Clone(nil), nil /* linkHeader */)
}
// Attach saves the stack network-layer dispatcher for use later when packets
@@ -134,5 +134,22 @@ func (e *Endpoint) WritePacket(_ *stack.Route, gso *stack.GSO, hdr buffer.Prepen
return nil
}
+// WriteRawPacket implements stack.LinkEndpoint.WriteRawPacket.
+func (e *Endpoint) WriteRawPacket(packet buffer.VectorisedView) *tcpip.Error {
+ p := PacketInfo{
+ Header: packet.ToView(),
+ Proto: 0,
+ Payload: buffer.View{},
+ GSO: nil,
+ }
+
+ select {
+ case e.C <- p:
+ default:
+ }
+
+ return nil
+}
+
// Wait implements stack.LinkEndpoint.Wait.
func (*Endpoint) Wait() {}