summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/network/arp/arp.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-03-16 17:34:27 +0000
committergVisor bot <gvisor-bot@google.com>2021-03-16 17:34:27 +0000
commit8663fa59e76a84e284b4e726a487f4920c5b4a76 (patch)
treeaca473b6adf0d1d3bb8f328a00437e453cd21254 /pkg/tcpip/network/arp/arp.go
parent34cc37e563c44dc9c16322a8640f944597648a84 (diff)
parentebd7c1b889e5d212f4a694d3addbada241936e8e (diff)
Merge release-20210309.0-31-gebd7c1b88 (automated)
Diffstat (limited to 'pkg/tcpip/network/arp/arp.go')
-rw-r--r--pkg/tcpip/network/arp/arp.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/pkg/tcpip/network/arp/arp.go b/pkg/tcpip/network/arp/arp.go
index ae0461a6d..43a4b7cac 100644
--- a/pkg/tcpip/network/arp/arp.go
+++ b/pkg/tcpip/network/arp/arp.go
@@ -305,8 +305,6 @@ func (*endpoint) LinkAddressProtocol() tcpip.NetworkProtocolNumber {
// LinkAddressRequest implements stack.LinkAddressResolver.LinkAddressRequest.
func (e *endpoint) LinkAddressRequest(targetAddr, localAddr tcpip.Address, remoteLinkAddr tcpip.LinkAddress) tcpip.Error {
- nicID := e.nic.ID()
-
stats := e.stats.arp
if len(remoteLinkAddr) == 0 {
@@ -314,9 +312,9 @@ func (e *endpoint) LinkAddressRequest(targetAddr, localAddr tcpip.Address, remot
}
if len(localAddr) == 0 {
- addr, ok := e.protocol.stack.GetMainNICAddress(nicID, header.IPv4ProtocolNumber)
- if !ok {
- return &tcpip.ErrUnknownNICID{}
+ addr, err := e.nic.PrimaryAddress(header.IPv4ProtocolNumber)
+ if err != nil {
+ return err
}
if len(addr.Address) == 0 {