diff options
author | Nick Brown <nickbrow@google.com> | 2021-03-24 09:36:50 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-03-24 09:38:27 -0700 |
commit | ec0aa657edfd98a1e8dfbbf017ee6cf8c7f1a40e (patch) | |
tree | 8506257a2992c91db2d2c3b1e7d29eb9ef5279bc /pkg/tcpip/stack/ndp_test.go | |
parent | 8ee4a3f6d0e75e51e088a431376d2976b0dac866 (diff) |
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
Diffstat (limited to 'pkg/tcpip/stack/ndp_test.go')
-rw-r--r-- | pkg/tcpip/stack/ndp_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/tcpip/stack/ndp_test.go b/pkg/tcpip/stack/ndp_test.go index 43e6d102c..0725e028b 100644 --- a/pkg/tcpip/stack/ndp_test.go +++ b/pkg/tcpip/stack/ndp_test.go @@ -578,8 +578,8 @@ func TestDADResolve(t *testing.T) { r, err := s.FindRoute(nicID, "", addr2, header.IPv6ProtocolNumber, false) if err != nil { t.Errorf("got FindRoute(%d, '', %s, %d, false): %s", nicID, addr2, header.IPv6ProtocolNumber, err) - } else if r.LocalAddress != addr1 { - t.Errorf("got r.LocalAddress = %s, want = %s", r.LocalAddress, addr1) + } else if r.LocalAddress() != addr1 { + t.Errorf("got r.LocalAddress() = %s, want = %s", r.LocalAddress(), addr1) } r.Release() } @@ -587,8 +587,8 @@ func TestDADResolve(t *testing.T) { r, err := s.FindRoute(nicID, addr1, addr2, header.IPv6ProtocolNumber, false) if err != nil { t.Errorf("got FindRoute(%d, %s, %s, %d, false): %s", nicID, addr1, addr2, header.IPv6ProtocolNumber, err) - } else if r.LocalAddress != addr1 { - t.Errorf("got r.LocalAddress = %s, want = %s", r.LocalAddress, addr1) + } else if r.LocalAddress() != addr1 { + t.Errorf("got r.LocalAddress() = %s, want = %s", r.LocalAddress(), addr1) } if r != nil { r.Release() |