summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/stack/registration.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/registration.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/registration.go')
-rw-r--r--pkg/tcpip/stack/registration.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/tcpip/stack/registration.go b/pkg/tcpip/stack/registration.go
index 85f0f471a..ff3a385e1 100644
--- a/pkg/tcpip/stack/registration.go
+++ b/pkg/tcpip/stack/registration.go
@@ -525,6 +525,14 @@ type NetworkInterface interface {
// assigned to it.
Spoofing() bool
+ // PrimaryAddress returns the primary address associated with the interface.
+ //
+ // PrimaryAddress will return the first non-deprecated address if such an
+ // address exists. If no non-deprecated addresses exist, the first deprecated
+ // address will be returned. If no deprecated addresses exist, the zero value
+ // will be returned.
+ PrimaryAddress(tcpip.NetworkProtocolNumber) (tcpip.AddressWithPrefix, tcpip.Error)
+
// CheckLocalAddress returns true if the address exists on the interface.
CheckLocalAddress(tcpip.NetworkProtocolNumber, tcpip.Address) bool