diff options
-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 } |