summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/stack/nic.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-01-16 02:31:32 +0000
committergVisor bot <gvisor-bot@google.com>2021-01-16 02:31:32 +0000
commit1a5ad08a03f35c80f1ed18d7775e6322d8ba80ca (patch)
tree5158696d6cf7dcdf555e91471aa6f3260015b0a3 /pkg/tcpip/stack/nic.go
parenta22726e7b37507e88a2146509477ef5d400df23e (diff)
parent2814a032be7b34e4cc0c0607dba8030e74e11208 (diff)
Merge release-20210112.0-39-g2814a032b (automated)
Diffstat (limited to 'pkg/tcpip/stack/nic.go')
-rw-r--r--pkg/tcpip/stack/nic.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/tcpip/stack/nic.go b/pkg/tcpip/stack/nic.go
index c8d0323cb..9e106a161 100644
--- a/pkg/tcpip/stack/nic.go
+++ b/pkg/tcpip/stack/nic.go
@@ -547,6 +547,15 @@ func (n *NIC) removeAddress(addr tcpip.Address) *tcpip.Error {
return tcpip.ErrBadLocalAddress
}
+func (n *NIC) getNeighborLinkAddress(addr, localAddr tcpip.Address, linkRes LinkAddressResolver, onResolve func(tcpip.LinkAddress, bool)) (tcpip.LinkAddress, <-chan struct{}, *tcpip.Error) {
+ if n.neigh != nil {
+ entry, ch, err := n.neigh.entry(addr, localAddr, linkRes, onResolve)
+ return entry.LinkAddr, ch, err
+ }
+
+ return n.stack.linkAddrCache.get(tcpip.FullAddress{NIC: n.ID(), Addr: addr}, linkRes, localAddr, n, onResolve)
+}
+
func (n *NIC) neighbors() ([]NeighborEntry, *tcpip.Error) {
if n.neigh == nil {
return nil, tcpip.ErrNotSupported