diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-09-21 02:57:40 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-09-21 02:57:40 +0000 |
commit | e63e69b939d0634b4fe6e59644deeede6930ca82 (patch) | |
tree | 5d0ef55fe0d4595dd6d1840c06eb37536dfbabce | |
parent | 0f37cc03d9689ba9359594253c1cc0f7faac0fa6 (diff) | |
parent | 3fe8d7ecf193b4efd099ceabe2d39a119ffe4fbc (diff) |
Merge release-20210906.0-50-g3fe8d7ecf (automated)
-rw-r--r-- | pkg/tcpip/transport/packet/endpoint.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/pkg/tcpip/transport/packet/endpoint.go b/pkg/tcpip/transport/packet/endpoint.go index d669fe55e..e4a64e191 100644 --- a/pkg/tcpip/transport/packet/endpoint.go +++ b/pkg/tcpip/transport/packet/endpoint.go @@ -318,8 +318,14 @@ func (ep *endpoint) Bind(addr tcpip.FullAddress) tcpip.Error { } // GetLocalAddress implements tcpip.Endpoint.GetLocalAddress. -func (*endpoint) GetLocalAddress() (tcpip.FullAddress, tcpip.Error) { - return tcpip.FullAddress{}, &tcpip.ErrNotSupported{} +func (ep *endpoint) GetLocalAddress() (tcpip.FullAddress, tcpip.Error) { + ep.mu.RLock() + defer ep.mu.RUnlock() + + return tcpip.FullAddress{ + NIC: ep.boundNIC, + Port: uint16(ep.boundNetProto), + }, nil } // GetRemoteAddress implements tcpip.Endpoint.GetRemoteAddress. |