From 0a55f8c1c11dc6d2dfb1bed02489f92bab437ea1 Mon Sep 17 00:00:00 2001
From: Zhaozhong Ni <nzz@google.com>
Date: Mon, 30 Jul 2018 15:42:01 -0700
Subject: netstack: support disconnect-on-save option per fdbased link.

PiperOrigin-RevId: 206659972
Change-Id: I5e0e035f97743b6525ad36bed2c802791609beaf
---
 pkg/tcpip/link/fdbased/endpoint.go | 10 ++++++++++
 1 file changed, 10 insertions(+)

(limited to 'pkg/tcpip/link/fdbased')

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,
-- 
cgit v1.2.3