summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/socketops.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-12-10 00:26:19 +0000
committergVisor bot <gvisor-bot@google.com>2020-12-10 00:26:19 +0000
commit23f464469bb7ccd79928a7a749219336b7bcb2c0 (patch)
treee2e9e61f29e18cadb71aa78302865d807733f95a /pkg/tcpip/socketops.go
parent1faf5799ed1fb83a36c6433b22a7c8f495395943 (diff)
parent92ca72ecb73d91e9def31e7f9835adf7a50b3d65 (diff)
Merge release-20201130.0-74-g92ca72ecb (automated)
Diffstat (limited to 'pkg/tcpip/socketops.go')
-rw-r--r--pkg/tcpip/socketops.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/tcpip/socketops.go b/pkg/tcpip/socketops.go
index c53698a6a..b14df9e09 100644
--- a/pkg/tcpip/socketops.go
+++ b/pkg/tcpip/socketops.go
@@ -130,6 +130,10 @@ type SocketOptions struct {
// corkOptionEnabled is used to specify if data should be held until segments
// are full by the TCP transport protocol.
corkOptionEnabled uint32
+
+ // receiveOriginalDstAddress is used to specify if the original destination of
+ // the incoming packet should be returned as an ancillary message.
+ receiveOriginalDstAddress uint32
}
// InitHandler initializes the handler. This must be called before using the
@@ -302,3 +306,13 @@ func (so *SocketOptions) SetCorkOption(v bool) {
storeAtomicBool(&so.corkOptionEnabled, v)
so.handler.OnCorkOptionSet(v)
}
+
+// GetReceiveOriginalDstAddress gets value for IP(V6)_RECVORIGDSTADDR option.
+func (so *SocketOptions) GetReceiveOriginalDstAddress() bool {
+ return atomic.LoadUint32(&so.receiveOriginalDstAddress) != 0
+}
+
+// SetReceiveOriginalDstAddress sets value for IP(V6)_RECVORIGDSTADDR option.
+func (so *SocketOptions) SetReceiveOriginalDstAddress(v bool) {
+ storeAtomicBool(&so.receiveOriginalDstAddress, v)
+}