From fd5b52c87ff8fbabf2b293fc95ec9f9f04e5621c Mon Sep 17 00:00:00 2001 From: Ghanan Gowripalan Date: Fri, 15 Jan 2021 16:46:51 -0800 Subject: Only pass stack.Route's fields to LinkEndpoints stack.Route is used to send network packets and resolve link addresses. A LinkEndpoint does not need to do either of these and only needs the route's fields at the time of the packet write request. Since LinkEndpoints only need the route's fields when writing packets, pass a stack.RouteInfo instead. PiperOrigin-RevId: 352108405 --- pkg/tcpip/stack/route.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/tcpip/stack/route.go') diff --git a/pkg/tcpip/stack/route.go b/pkg/tcpip/stack/route.go index b0251d0b4..ac163904c 100644 --- a/pkg/tcpip/stack/route.go +++ b/pkg/tcpip/stack/route.go @@ -90,9 +90,9 @@ type RouteInfo struct { RemoteLinkAddress tcpip.LinkAddress } -// GetFields returns a RouteInfo with all of r's exported fields. This allows +// Fields returns a RouteInfo with all of r's exported fields. This allows // callers to store the route's fields without retaining a reference to it. -func (r *Route) GetFields() RouteInfo { +func (r *Route) Fields() RouteInfo { return RouteInfo{ routeInfo: r.routeInfo, RemoteLinkAddress: r.RemoteLinkAddress(), -- cgit v1.2.3