Fix NetX I/O: differentiate transient errors from fatal ones - #11257
Closed
embhorn wants to merge 2 commits into
Closed
Fix NetX I/O: differentiate transient errors from fatal ones#11257embhorn wants to merge 2 commits into
embhorn wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Improves NetX Duo I/O integration by mapping transient NetX status codes to non-fatal wolfSSL CBIO “want read/write” errors, enabling reliable non-blocking and short-wait TLS/DTLS operation.
Changes:
- Added
NetX_TranslateReturnCode()and used it across NetX TLS/DTLS send/receive callbacks. - Fixed NetX
SOCKET_E*aliases to better match NetX status codes (no errno). - Updated ThreadX CI configuration to compile DTLS/DTLS1.3 to cover UDP callback builds.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
wolfssl/wolfio.h |
Corrects NetX SOCKET_E* aliases to map to more appropriate NetX status codes. |
src/wolfio.c |
Introduces shared NetX status→CBIO translation and applies it to TCP/UDP callbacks. |
doc/dox_comments/header_files/wolfio.h |
Documents non-blocking/expiring-wait behavior as WANT_READ/WANT_WRITE instead of fatal errors. |
.github/workflows/threadx.yml |
Enables DTLS/DTLS1.3 in ThreadX CI job for compile coverage of UDP code paths. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Can one of the admins verify this patch? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The native NetX callbacks mapped every non-NX_SUCCESS status to
WOLFSSL_CBIO_ERR_GENERAL, which the TLS layer treats as fatal. Non-blocking operation (nxWaitset toNX_NO_WAITor any expiring wait option) was therefore impossible: a "no data yet" from the stack killed the connection.Adds
NetX_TranslateReturnCode()and uses it inNetX_Receive,NetX_Send,NetX_ReceiveFrom, andNetX_SendTo:NX_NO_PACKET,NX_WINDOW_OVERFLOW,NX_TX_QUEUE_DEPTH->WANT_READ/WANT_WRITENX_WAIT_ABORTED->ERR_ISRNX_NOT_CONNECTED->ERR_CONN_CLOSEERR_GENERAL, unchangedAlso fixes the
HAVE_NETX SOCKET_E*aliases in wolfssl/wolfio.h, which all mapped toNX_NOT_CONNECTED, and enables DTLS in the ThreadX CI job so the NetX Duo UDP callbacks get compile coverage.Blocking users (
NX_WAIT_FOREVER) see no behavior change.Fixes ZD22372
Testing
Compiled locally, customer confirmed
Checklist