summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/link/fdbased/endpoint.go
diff options
context:
space:
mode:
authorZhaozhong Ni <nzz@google.com>2018-07-30 15:42:01 -0700
committerShentubot <shentubot@google.com>2018-07-30 15:43:25 -0700
commit0a55f8c1c11dc6d2dfb1bed02489f92bab437ea1 (patch)
tree803d15586a86a79f30e2905d03ad06a11fe38bee /pkg/tcpip/link/fdbased/endpoint.go
parent3188859742e802a2e7d1d5d0ab22a6e2b426dfb8 (diff)
netstack: support disconnect-on-save option per fdbased link.
PiperOrigin-RevId: 206659972 Change-Id: I5e0e035f97743b6525ad36bed2c802791609beaf
Diffstat (limited to 'pkg/tcpip/link/fdbased/endpoint.go')
-rw-r--r--pkg/tcpip/link/fdbased/endpoint.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/tcpip/link/fdbased/endpoint.go b/pkg/tcpip/link/fdbased/endpoint.go
index 8fc009160..4e20cfbf8 100644
--- a/pkg/tcpip/link/fdbased/endpoint.go
+++ b/pkg/tcpip/link/fdbased/endpoint.go
@@ -69,6 +69,8 @@ type Options struct {
ChecksumOffload bool
ClosedFunc func(*tcpip.Error)
Address tcpip.LinkAddress
+ SaveRestore bool
+ DisconnectOk bool
}
// New creates a new fd-based endpoint.
@@ -89,6 +91,14 @@ func New(opts *Options) tcpip.LinkEndpointID {
caps |= stack.CapabilityResolutionRequired
}
+ if opts.SaveRestore {
+ caps |= stack.CapabilitySaveRestore
+ }
+
+ if opts.DisconnectOk {
+ caps |= stack.CapabilityDisconnectOk
+ }
+
e := &endpoint{
fd: opts.FD,
mtu: opts.MTU,