summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/stack/stack.go
diff options
context:
space:
mode:
authorGhanan Gowripalan <ghanan@google.com>2021-03-16 10:28:04 -0700
committergVisor bot <gvisor-bot@google.com>2021-03-16 10:29:49 -0700
commitebd7c1b889e5d212f4a694d3addbada241936e8e (patch)
tree3af9e3404d691cfe29508e74e971576f5ea1379c /pkg/tcpip/stack/stack.go
parentf7e841c2cede357c4cbd6117605e3f3d54f1961c (diff)
Do not call into Stack from LinkAddressRequest
Calling into the stack from LinkAddressRequest is not needed as we already have a reference to the network endpoint (IPv6) or network interface (IPv4/ARP). PiperOrigin-RevId: 363213973
Diffstat (limited to 'pkg/tcpip/stack/stack.go')
-rw-r--r--pkg/tcpip/stack/stack.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/tcpip/stack/stack.go b/pkg/tcpip/stack/stack.go
index 53370c354..1fffe9274 100644
--- a/pkg/tcpip/stack/stack.go
+++ b/pkg/tcpip/stack/stack.go
@@ -1224,7 +1224,8 @@ func (s *Stack) GetMainNICAddress(id tcpip.NICID, protocol tcpip.NetworkProtocol
return tcpip.AddressWithPrefix{}, false
}
- return nic.primaryAddress(protocol), true
+ addr, err := nic.PrimaryAddress(protocol)
+ return addr, err == nil
}
func (s *Stack) getAddressEP(nic *nic, localAddr, remoteAddr tcpip.Address, netProto tcpip.NetworkProtocolNumber) AssignableAddressEndpoint {