summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/tcpip')
-rw-r--r--pkg/tcpip/adapters/gonet/gonet.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/tcpip/adapters/gonet/gonet.go b/pkg/tcpip/adapters/gonet/gonet.go
index 1f2bcaf65..16650024f 100644
--- a/pkg/tcpip/adapters/gonet/gonet.go
+++ b/pkg/tcpip/adapters/gonet/gonet.go
@@ -449,6 +449,15 @@ func (c *TCPConn) RemoteAddr() net.Addr {
return fullToTCPAddr(a)
}
+// Extension
+func (c *TCPConn) OriginalDestinationAddr() net.Addr {
+ var v tcpip.OriginalDestinationOption
+ if err := c.ep.GetSockOpt(&v); err != nil {
+ return nil
+ }
+ return fullToTCPAddr(tcpip.FullAddress(v))
+}
+
func (c *TCPConn) newOpError(op string, err error) *net.OpError {
return &net.OpError{
Op: op,