diff --git a/pkg/tcpip/stack/route.go b/pkg/tcpip/stack/route.go index c7006577f..d2535f9bd 100644 --- a/pkg/tcpip/stack/route.go +++ b/pkg/tcpip/stack/route.go @@ -327,8 +327,8 @@ func (r *Route) HasSaveRestoreCapability() bool { return r.outgoingNIC.NetworkLinkEndpoint.Capabilities()&CapabilitySaveRestore != 0 } -// HasDisconncetOkCapability returns true if the route supports disconnecting. -func (r *Route) HasDisconncetOkCapability() bool { +// HasDisconnectOkCapability returns true if the route supports disconnecting. +func (r *Route) HasDisconnectOkCapability() bool { return r.outgoingNIC.NetworkLinkEndpoint.Capabilities()&CapabilityDisconnectOk != 0 } diff --git a/pkg/tcpip/transport/tcp/endpoint_state.go b/pkg/tcpip/transport/tcp/endpoint_state.go index 4e48de8e8..bb2bc4c8f 100644 --- a/pkg/tcpip/transport/tcp/endpoint_state.go +++ b/pkg/tcpip/transport/tcp/endpoint_state.go @@ -38,7 +38,7 @@ func (e *endpoint) beforeSave() { case epState == StateInitial || epState == StateBound: case epState.connected() || epState.handshake(): if !e.route.HasSaveRestoreCapability() { - if !e.route.HasDisconncetOkCapability() { + if !e.route.HasDisconnectOkCapability() { panic(&tcpip.ErrSaveRejection{ Err: fmt.Errorf("endpoint cannot be saved in connected state: local %s:%d, remote %s:%d", e.TransportEndpointInfo.ID.LocalAddress, e.TransportEndpointInfo.ID.LocalPort, e.TransportEndpointInfo.ID.RemoteAddress, e.TransportEndpointInfo.ID.RemotePort), })