diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-07-22 22:38:51 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-07-22 22:38:51 +0000 |
commit | 16fd9f8968bdccfdc945f65a76209488fdd9e6c6 (patch) | |
tree | 853117badf01344dcc3ac504a59e9ecaeef6978c /pkg/tcpip/link/waitable | |
parent | f63bb21f7e5f013b28205f4643b027b651524c93 (diff) | |
parent | 71bf90c55bd888f9b9c493533ca5e4b2b4b3d21d (diff) |
Merge release-20200622.1-184-g71bf90c55 (automated)
Diffstat (limited to 'pkg/tcpip/link/waitable')
-rw-r--r-- | pkg/tcpip/link/waitable/waitable.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/tcpip/link/waitable/waitable.go b/pkg/tcpip/link/waitable/waitable.go index 24a8dc2eb..b152a0f26 100644 --- a/pkg/tcpip/link/waitable/waitable.go +++ b/pkg/tcpip/link/waitable/waitable.go @@ -60,6 +60,15 @@ func (e *Endpoint) DeliverNetworkPacket(remote, local tcpip.LinkAddress, protoco e.dispatchGate.Leave() } +// DeliverOutboundPacket implements stack.NetworkDispatcher.DeliverOutboundPacket. +func (e *Endpoint) DeliverOutboundPacket(remote, local tcpip.LinkAddress, protocol tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer) { + if !e.dispatchGate.Enter() { + return + } + e.dispatcher.DeliverOutboundPacket(remote, local, protocol, pkt) + e.dispatchGate.Leave() +} + // Attach implements stack.LinkEndpoint.Attach. It saves the dispatcher and // registers with the lower endpoint as its dispatcher so that "e" is called // for inbound packets. @@ -153,3 +162,8 @@ func (e *Endpoint) Wait() {} func (e *Endpoint) ARPHardwareType() header.ARPHardwareType { return e.lower.ARPHardwareType() } + +// AddHeader implements stack.LinkEndpoint.AddHeader. +func (e *Endpoint) AddHeader(local, remote tcpip.LinkAddress, protocol tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer) { + e.lower.AddHeader(local, remote, protocol, pkt) +} |