Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better handle TCP/IP stack crashes in the TLS compartment. #23

Merged
merged 1 commit into from
May 22, 2024

Conversation

hlef
Copy link
Collaborator

@hlef hlef commented May 16, 2024

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.

@hlef hlef requested a review from davidchisnall May 16, 2024 03:43
lib/tls/tls.cc Outdated Show resolved Hide resolved
lib/tls/tls.cc Outdated Show resolved Hide resolved
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.

Signed-off-by: Hugo Lefeuvre <[email protected]>
@hlef hlef force-pushed the hlefeuvre/tcpip-crash-return-values branch from 8ca53ea to ae5d33b Compare May 21, 2024 08:33
@hlef
Copy link
Collaborator Author

hlef commented May 21, 2024

@davidchisnall Updated to address the comments.

@davidchisnall davidchisnall merged commit ef3fe19 into main May 22, 2024
2 checks passed
@davidchisnall davidchisnall deleted the hlefeuvre/tcpip-crash-return-values branch May 22, 2024 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants