summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/tcp
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@google.com>2021-01-26 13:01:26 -0800
committergVisor bot <gvisor-bot@google.com>2021-01-26 13:03:40 -0800
commitce39f82985b95972c545c941be2133b607b4440c (patch)
tree01e450ef81e9b3148161b9241e6b6f2c27893f2d /pkg/tcpip/transport/tcp
parenta90661654d14e77b6442c4a34ced900e2cd9953e (diff)
Implement error on pointers
This improves type-assertion safety. PiperOrigin-RevId: 353931228
Diffstat (limited to 'pkg/tcpip/transport/tcp')
-rw-r--r--pkg/tcpip/transport/tcp/endpoint_state.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/tcpip/transport/tcp/endpoint_state.go b/pkg/tcpip/transport/tcp/endpoint_state.go
index 19c1dc67a..fa8ffaee0 100644
--- a/pkg/tcpip/transport/tcp/endpoint_state.go
+++ b/pkg/tcpip/transport/tcp/endpoint_state.go
@@ -55,7 +55,9 @@ func (e *endpoint) beforeSave() {
case epState.connected() || epState.handshake():
if !e.route.HasSaveRestoreCapability() {
if !e.route.HasDisconncetOkCapability() {
- panic(tcpip.ErrSaveRejection{fmt.Errorf("endpoint cannot be saved in connected state: local %v:%d, remote %v:%d", e.ID.LocalAddress, e.ID.LocalPort, e.ID.RemoteAddress, e.ID.RemotePort)})
+ panic(&tcpip.ErrSaveRejection{
+ Err: fmt.Errorf("endpoint cannot be saved in connected state: local %s:%d, remote %s:%d", e.ID.LocalAddress, e.ID.LocalPort, e.ID.RemoteAddress, e.ID.RemotePort),
+ })
}
e.resetConnectionLocked(tcpip.ErrConnectionAborted)
e.mu.Unlock()