From ec0aa657edfd98a1e8dfbbf017ee6cf8c7f1a40e Mon Sep 17 00:00:00 2001 From: Nick Brown Date: Wed, 24 Mar 2021 09:36:50 -0700 Subject: Unexpose immutable fields in stack.Route This change sets the inner `routeInfo` struct to be a named private member and replaces direct access with access through getters. Note that direct access to the fields of `routeInfo` is still possible through the `RouteInfo` struct. Fixes #4902 PiperOrigin-RevId: 364822872 --- pkg/tcpip/transport/raw/endpoint.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/tcpip/transport/raw') diff --git a/pkg/tcpip/transport/raw/endpoint.go b/pkg/tcpip/transport/raw/endpoint.go index 2709be90c..4b2f08379 100644 --- a/pkg/tcpip/transport/raw/endpoint.go +++ b/pkg/tcpip/transport/raw/endpoint.go @@ -614,7 +614,7 @@ func (e *endpoint) HandlePacket(pkt *stack.PacketBuffer) { // If connected, only accept packets from the remote address we // connected to. - if e.connected && e.route.RemoteAddress != remoteAddr { + if e.connected && e.route.RemoteAddress() != remoteAddr { e.rcvMu.Unlock() e.mu.RUnlock() return -- cgit v1.2.3