summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/stack/linkaddrcache.go
diff options
context:
space:
mode:
authorGhanan Gowripalan <ghanan@google.com>2021-01-15 18:47:10 -0800
committergVisor bot <gvisor-bot@google.com>2021-01-15 18:49:22 -0800
commitcd75bb163f46bbe238945b98d50c7b33e60d4490 (patch)
tree59e62d48d8dc0dd0663c1559087d288a714dcc38 /pkg/tcpip/stack/linkaddrcache.go
parent2814a032be7b34e4cc0c0607dba8030e74e11208 (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/linkaddrcache.go')
-rw-r--r--pkg/tcpip/stack/linkaddrcache.go9
1 files changed, 0 insertions, 9 deletions
diff --git a/pkg/tcpip/stack/linkaddrcache.go b/pkg/tcpip/stack/linkaddrcache.go
index 792f4f170..b600a1cab 100644
--- a/pkg/tcpip/stack/linkaddrcache.go
+++ b/pkg/tcpip/stack/linkaddrcache.go
@@ -182,15 +182,6 @@ func (c *linkAddrCache) getOrCreateEntryLocked(k tcpip.FullAddress) *linkAddrEnt
// get reports any known link address for k.
func (c *linkAddrCache) get(k tcpip.FullAddress, linkRes LinkAddressResolver, localAddr tcpip.Address, nic NetworkInterface, onResolve func(tcpip.LinkAddress, bool)) (tcpip.LinkAddress, <-chan struct{}, *tcpip.Error) {
- if linkRes != nil {
- if addr, ok := linkRes.ResolveStaticAddress(k.Addr); ok {
- if onResolve != nil {
- onResolve(addr, true)
- }
- return addr, nil, nil
- }
- }
-
c.cache.Lock()
defer c.cache.Unlock()
entry := c.getOrCreateEntryLocked(k)