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
This commit is contained in:
Tony Gong
2021-10-15 14:04:13 -07:00
committed by gVisor bot
parent 04dc27899b
commit e4fc15bd88
+3 -1
View File
@@ -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)
}