diff options
author | Ghanan Gowripalan <ghanan@google.com> | 2021-01-19 16:54:48 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-01-19 16:56:49 -0800 |
commit | 7ff5ceaeae66303ed6a2199963c00cb08b2fe7ca (patch) | |
tree | 5b2ab07f55394c2106a4cbd71046cc069b681f23 /pkg/tcpip/network/arp | |
parent | 48ea2c34d1d3dead7727d9e2760b587c7609b14b (diff) |
Do not have a stack-wide linkAddressCache
Link addresses are cached on a per NIC basis so instead of having a
single cache that includes the NIC ID for neighbor entry lookups,
use a single cache per NIC.
PiperOrigin-RevId: 352684111
Diffstat (limited to 'pkg/tcpip/network/arp')
-rw-r--r-- | pkg/tcpip/network/arp/arp.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/tcpip/network/arp/arp.go b/pkg/tcpip/network/arp/arp.go index 1d4d2966e..9255a4f6a 100644 --- a/pkg/tcpip/network/arp/arp.go +++ b/pkg/tcpip/network/arp/arp.go @@ -147,7 +147,7 @@ func (e *endpoint) HandlePacket(pkt *stack.PacketBuffer) { remoteLinkAddr := tcpip.LinkAddress(h.HardwareAddressSender()) if e.nud == nil { - e.linkAddrCache.AddLinkAddress(e.nic.ID(), remoteAddr, remoteLinkAddr) + e.linkAddrCache.AddLinkAddress(remoteAddr, remoteLinkAddr) } else { e.nud.HandleProbe(remoteAddr, ProtocolNumber, remoteLinkAddr, e.protocol) } @@ -191,7 +191,7 @@ func (e *endpoint) HandlePacket(pkt *stack.PacketBuffer) { linkAddr := tcpip.LinkAddress(h.HardwareAddressSender()) if e.nud == nil { - e.linkAddrCache.AddLinkAddress(e.nic.ID(), addr, linkAddr) + e.linkAddrCache.AddLinkAddress(addr, linkAddr) return } |