diff options
author | Ghanan Gowripalan <ghanan@google.com> | 2021-01-15 18:47:10 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-01-15 18:49:22 -0800 |
commit | cd75bb163f46bbe238945b98d50c7b33e60d4490 (patch) | |
tree | 59e62d48d8dc0dd0663c1559087d288a714dcc38 /pkg/tcpip/stack/stack.go | |
parent | 2814a032be7b34e4cc0c0607dba8030e74e11208 (diff) |
Resolve known link address on route creation
If a Route is being created through a link that requires link address
resolution and a remote address that has a known mapping to a link
address, populate the link address when the route is created.
This removes the need for neighbor/link address caches to perform this
check.
Fixes #5149
PiperOrigin-RevId: 352122401
Diffstat (limited to 'pkg/tcpip/stack/stack.go')
-rw-r--r-- | pkg/tcpip/stack/stack.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/tcpip/stack/stack.go b/pkg/tcpip/stack/stack.go index 281bb7a9d..6d761b125 100644 --- a/pkg/tcpip/stack/stack.go +++ b/pkg/tcpip/stack/stack.go @@ -1329,6 +1329,7 @@ func (s *Stack) FindRoute(id tcpip.NICID, localAddr, remoteAddr tcpip.Address, n if addressEndpoint := s.getAddressEP(nic, localAddr, remoteAddr, netProto); addressEndpoint != nil { return makeRoute( netProto, + "", /* gateway */ localAddr, remoteAddr, nic, /* outboundNIC */ @@ -1518,7 +1519,7 @@ func (s *Stack) AddLinkAddress(nicID tcpip.NICID, addr tcpip.Address, linkAddr t // that AddLinkAddress for a particular address has been called. } -// GetLinkAddress finds the link address corresponding to the remote address. +// GetLinkAddress finds the link address corresponding to a neighbor's address. // // Returns a link address for the remote address, if readily available. // |