diff options
Diffstat (limited to 'pkg/tcpip/link/muxed/injectable.go')
-rw-r--r-- | pkg/tcpip/link/muxed/injectable.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/pkg/tcpip/link/muxed/injectable.go b/pkg/tcpip/link/muxed/injectable.go index 9d85bda60..29073afae 100644 --- a/pkg/tcpip/link/muxed/injectable.go +++ b/pkg/tcpip/link/muxed/injectable.go @@ -94,7 +94,17 @@ func (m *InjectableEndpoint) WritePacket(r *stack.Route, hdr buffer.Prependable, return tcpip.ErrNoRoute } -// NewInjectableEndpoint creates a new multi-fd-based injectable endpoint. +// WriteRawPacket writes outbound packets to the appropriate +// LinkInjectableEndpoint based on the dest address. +func (m *InjectableEndpoint) WriteRawPacket(dest tcpip.Address, packet []byte) *tcpip.Error { + endpoint, ok := m.routes[dest] + if !ok { + return tcpip.ErrNoRoute + } + return endpoint.WriteRawPacket(dest, packet) +} + +// NewInjectableEndpoint creates a new multi-endpoint injectable endpoint. func NewInjectableEndpoint(routes map[tcpip.Address]stack.InjectableLinkEndpoint, mtu uint32) (tcpip.LinkEndpointID, *InjectableEndpoint) { e := &InjectableEndpoint{ routes: routes, |