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_test.go | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'pkg/tcpip/stack/linkaddrcache_test.go') diff --git a/pkg/tcpip/stack/linkaddrcache_test.go b/pkg/tcpip/stack/linkaddrcache_test.go index 03b2f2d6f..d7ac6cf5f 100644 --- a/pkg/tcpip/stack/linkaddrcache_test.go +++ b/pkg/tcpip/stack/linkaddrcache_test.go @@ -273,20 +273,3 @@ func TestCacheResolutionTimeout(t *testing.T) { t.Errorf("got getBlocking(_, %#v, _) = (%s, %s), want = (_, %s)", e.addr, a, err, tcpip.ErrTimeout) } } - -// TestStaticResolution checks that static link addresses are resolved immediately and don't -// send resolution requests. -func TestStaticResolution(t *testing.T) { - c := newLinkAddrCache(1<<63-1, time.Millisecond, 1) - linkRes := &testLinkAddressResolver{cache: c, delay: time.Minute} - - addr := tcpip.Address("broadcast") - want := tcpip.LinkAddress("mac_broadcast") - got, _, err := c.get(tcpip.FullAddress{Addr: addr}, linkRes, "", nil, nil) - if err != nil { - t.Errorf("c.get(%q)=%q, got error: %v", string(addr), string(got), err) - } - if got != want { - t.Errorf("c.get(%q)=%q, want %q", string(addr), string(got), string(want)) - } -} -- cgit v1.2.3