diff options
author | Ghanan Gowripalan <ghanan@google.com> | 2021-01-15 15:01:18 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-01-15 15:03:47 -0800 |
commit | 55c7fe48d223ee5678dff7f5bf9a9e5f0482ab37 (patch) | |
tree | fb6c14d5899ac66dca2ac81d4ca4e7ac52ae3182 /pkg/tcpip/link/packetsocket | |
parent | c7fc4a5d66dc5d6680219819f872c070a0590ca9 (diff) |
Populate EgressRoute, GSO, Netproto for batch writes
We loop over the list of packets anyways so setting these aren't
expensive.
Now that they are populated only by the link endpoint that uses them,
TCP does not need to.
PiperOrigin-RevId: 352090853
Diffstat (limited to 'pkg/tcpip/link/packetsocket')
-rw-r--r-- | pkg/tcpip/link/packetsocket/endpoint.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/tcpip/link/packetsocket/endpoint.go b/pkg/tcpip/link/packetsocket/endpoint.go index 9a1b0c0c2..917c02da3 100644 --- a/pkg/tcpip/link/packetsocket/endpoint.go +++ b/pkg/tcpip/link/packetsocket/endpoint.go @@ -43,7 +43,7 @@ func (e *endpoint) WritePacket(r *stack.Route, gso *stack.GSO, protocol tcpip.Ne // WritePackets implements stack.LinkEndpoint.WritePackets. func (e *endpoint) WritePackets(r *stack.Route, gso *stack.GSO, pkts stack.PacketBufferList, proto tcpip.NetworkProtocolNumber) (int, *tcpip.Error) { for pkt := pkts.Front(); pkt != nil; pkt = pkt.Next() { - e.Endpoint.DeliverOutboundPacket(pkt.EgressRoute.RemoteLinkAddress(), pkt.EgressRoute.LocalLinkAddress, pkt.NetworkProtocolNumber, pkt) + e.Endpoint.DeliverOutboundPacket(r.RemoteLinkAddress(), r.LocalLinkAddress, pkt.NetworkProtocolNumber, pkt) } return e.Endpoint.WritePackets(r, gso, pkts, proto) |