From cd75bb163f46bbe238945b98d50c7b33e60d4490 Mon Sep 17 00:00:00 2001 From: Ghanan Gowripalan Date: Fri, 15 Jan 2021 18:47:10 -0800 Subject: 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 --- pkg/tcpip/stack/linkaddrcache.go | 9 --------- 1 file changed, 9 deletions(-) (limited to 'pkg/tcpip/stack/linkaddrcache.go') 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) -- cgit v1.2.3