summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/tcpip.go
diff options
context:
space:
mode:
authorZhaozhong Ni <nzz@google.com>2018-06-05 15:43:38 -0700
committerShentubot <shentubot@google.com>2018-06-05 15:44:38 -0700
commit343020ca275298fe9ea3320628454cad5f0052aa (patch)
treedf1aafde73969ae67d38ba990803e0f662ea5dc0 /pkg/tcpip/tcpip.go
parent19a0e83b50fbcfd89927baedbb1f1fd14dc448ca (diff)
netstack: make TCP endpoint closed and error state cleanup work synchronous.
So that when saving TCP endpoint in these states, there is no pending or background activities. Also lift tcp network save rejection error to tcpip package. PiperOrigin-RevId: 199370748 Change-Id: Ief7b45c2a7338d12414cd7c23db95de6a9c22700
Diffstat (limited to 'pkg/tcpip/tcpip.go')
-rw-r--r--pkg/tcpip/tcpip.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/tcpip/tcpip.go b/pkg/tcpip/tcpip.go
index fdeba6bc4..cf25a086d 100644
--- a/pkg/tcpip/tcpip.go
+++ b/pkg/tcpip/tcpip.go
@@ -85,6 +85,17 @@ var (
errSubnetAddressMasked = errors.New("subnet address has bits set outside the mask")
)
+// ErrSaveRejection indicates a failed save due to unsupported networking state.
+// This type of errors is only used for save logic.
+type ErrSaveRejection struct {
+ Err error
+}
+
+// Error returns a sensible description of the save rejection error.
+func (e ErrSaveRejection) Error() string {
+ return "save rejected due to unsupported networking state: " + e.Err.Error()
+}
+
// A Clock provides the current time.
//
// Times returned by a Clock should always be used for application-visible