diff options
author | Tony Gong <gongt@google.com> | 2021-10-15 14:01:39 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-10-15 14:04:13 -0700 |
commit | e4fc15bd88f0b62fb8923f1417175f015482c0bd (patch) | |
tree | a61ac151b11bd017d3e43ce546a9bbd0f94fb99c /pkg/tcpip | |
parent | 04dc27899bbdeb9bbce2b2647856d160e8ccd78d (diff) |
Implement WriteRawPacket for pipe
Implement WriteRawPacket for pipe by calling `DeliverNetworkPacket`
on the other end with empty values for the route and protocol number,
and relies on the `NetworkDispatcher` to decapsulate the link layer
header from the raw packet itself.
PiperOrigin-RevId: 403461448
Diffstat (limited to 'pkg/tcpip')
-rw-r--r-- | pkg/tcpip/link/pipe/pipe.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/tcpip/link/pipe/pipe.go b/pkg/tcpip/link/pipe/pipe.go index 3ed0aa3fe..c67ca98ea 100644 --- a/pkg/tcpip/link/pipe/pipe.go +++ b/pkg/tcpip/link/pipe/pipe.go @@ -123,4 +123,6 @@ func (*Endpoint) AddHeader(_, _ tcpip.LinkAddress, _ tcpip.NetworkProtocolNumber } // WriteRawPacket implements stack.LinkEndpoint. -func (*Endpoint) WriteRawPacket(*stack.PacketBuffer) tcpip.Error { return &tcpip.ErrNotSupported{} } +func (e *Endpoint) WriteRawPacket(pkt *stack.PacketBuffer) tcpip.Error { + return e.WritePacket(stack.RouteInfo{}, 0, pkt) +} |