When the TCP/IP stack crashes, API calls to the compartment return -ECOMPARTMENTFAIL. These should be treated similarly to -ENOTCONN.
Currently -ECOMPARTMENTFAIL failures are not considered by the TLS compartment and are handled in various (incorrect) ways across the code-base. Address this.
While we are at it, avoid the call to network_socket_close if the socket is a nullptr.
When the TCP/IP stack crashes, API calls to the compartment return
-ECOMPARTMENTFAIL
. These should be treated similarly to-ENOTCONN
.Currently
-ECOMPARTMENTFAIL
failures are not considered by the TLS compartment and are handled in various (incorrect) ways across the code-base. Address this.While we are at it, avoid the call to
network_socket_close
if the socket is anullptr
.