summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/socketops.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-11-18 21:45:50 +0000
committergVisor bot <gvisor-bot@google.com>2020-11-18 21:45:50 +0000
commit077187bac84d6d2d6a2e728969a7211a4f520990 (patch)
tree25027b5712d18b48c33166f8e3046e87e69a8c38 /pkg/tcpip/socketops.go
parentcc20ad1486e549ae0924a1b4b3c18e7b3bf83eb9 (diff)
parent3e73c519a55191827dcc6e98ea0ffe977acbb73f (diff)
Merge release-20201109.0-77-g3e73c519a (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 e1b0d6354..cc3d59d9d 100644
--- a/pkg/tcpip/socketops.go
+++ b/pkg/tcpip/socketops.go
@@ -32,6 +32,10 @@ type SocketOptions struct {
// passCredEnabled determines whether SCM_CREDENTIALS socket control messages
// are enabled.
passCredEnabled uint32
+
+ // noChecksumEnabled determines whether UDP checksum is disabled while
+ // transmitting for this socket.
+ noChecksumEnabled uint32
}
func storeAtomicBool(addr *uint32, v bool) {
@@ -61,3 +65,13 @@ func (so *SocketOptions) GetPassCred() bool {
func (so *SocketOptions) SetPassCred(v bool) {
storeAtomicBool(&so.passCredEnabled, v)
}
+
+// GetNoChecksum gets value for SO_NO_CHECK option.
+func (so *SocketOptions) GetNoChecksum() bool {
+ return atomic.LoadUint32(&so.noChecksumEnabled) != 0
+}
+
+// SetNoChecksum sets value for SO_NO_CHECK option.
+func (so *SocketOptions) SetNoChecksum(v bool) {
+ storeAtomicBool(&so.noChecksumEnabled, v)
+}