diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-01-22 07:40:55 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-01-22 07:40:55 +0000 |
commit | 979ba6063d1b02c94ef2846b0bebe659a0aec031 (patch) | |
tree | 45670b527945e2a25ff9806fe0abacefd5b3ab04 | |
parent | e738c06755e8a89302771473098a7cbd1a930c53 (diff) | |
parent | e0f4e46e340f2f5e666332ac3ff14f113239400a (diff) |
Merge release-20210112.0-67-ge0f4e46e3 (automated)
-rw-r--r-- | pkg/tcpip/stack/stack.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/tcpip/stack/stack.go b/pkg/tcpip/stack/stack.go index 7885673fe..9a22554e5 100644 --- a/pkg/tcpip/stack/stack.go +++ b/pkg/tcpip/stack/stack.go @@ -1533,7 +1533,7 @@ type LinkResolutionResult struct { Success bool } -// GetLinkAddress finds the link address corresponding to a neighbor's address. +// GetLinkAddress finds the link address corresponding to a network address. // // Returns ErrNotSupported if the stack is not configured with a link address // resolver for the specified network protocol. @@ -1562,6 +1562,11 @@ func (s *Stack) GetLinkAddress(nicID tcpip.NICID, addr, localAddr tcpip.Address, return tcpip.ErrNotSupported } + if linkAddr, ok := linkRes.ResolveStaticAddress(addr); ok { + onResolve(LinkResolutionResult{LinkAddress: linkAddr, Success: true}) + return nil + } + _, _, err := nic.getNeighborLinkAddress(addr, localAddr, linkRes, onResolve) return err } |