io.c: use the zsock names on Zephyr 4.1 and newer - #1267
Merged
Merged
Conversation
Zephyr 4.1 dropped CONFIG_NET_SOCKETS_POSIX_NAMES, and from 4.4 the POSIX aliases in <zephyr/net/socket.h> need a compat mode wolfSSH does not set, so wsEmbedSend() and wsEmbedRecv() no longer found send() and recv(). Call zsock_send() and zsock_recv(), which Zephyr declares in every configuration, and include <zephyr/version.h> for the test.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review comments remain, and the compatibility changes are clearly scoped.
Pull request overview
Updates Zephyr socket compatibility for Zephyr 4.1+ while preserving older support.
Changes:
- Includes Zephyr version definitions.
- Uses
zsock_send()/zsock_recv()on newer Zephyr versions. - Retains POSIX socket names for older versions.
File summaries
| File | Summary |
|---|---|
src/io.c |
Adds version-aware Zephyr socket function selection. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
philljj
approved these changes
Sep 18, 2026
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.
Zephyr 4.1 dropped
CONFIG_NET_SOCKETS_POSIX_NAMES, and from 4.4 the POSIX aliases in<zephyr/net/socket.h>need a compat mode wolfSSH does not set, sowsEmbedSend()andwsEmbedRecv()stopped findingsend()andrecv(). The v4.4.0 Zephyr leg fails to build on master.zsock_send()andzsock_recv()from Zephyr 4.1 on, keeping the POSIX names for older releases<zephyr/version.h>forKERNEL_VERSION_NUMBERsrc/io.cis the only file in the Zephyr build that includes<zephyr/net/socket.h>directly; the examples reach sockets through<sys/socket.h>and the POSIX layer, so they need no change.Exposed by wolfSSL PR 11401 and 11431, which made the same change to wolfSSL's own
wolfio.h. The Zephyr workflow tracks wolfsslmaster, so this landed without a wolfSSH change.