Skip to content

io.c: use the zsock names on Zephyr 4.1 and newer - #1267

Merged
philljj merged 1 commit into
wolfSSL:masterfrom
ejohnstown:zephyr-zsock-names
Sep 18, 2026
Merged

philljj merged 1 commit into
wolfSSL:masterfrom
ejohnstown:zephyr-zsock-names

Conversation

@ejohnstown

@ejohnstown ejohnstown commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

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() stopped finding send() and recv(). The v4.4.0 Zephyr leg fails to build on master.

  • calls zsock_send() and zsock_recv() from Zephyr 4.1 on, keeping the POSIX names for older releases
  • includes <zephyr/version.h> for KERNEL_VERSION_NUMBER

src/io.c is 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 wolfssl master, so this landed without a wolfSSH change.

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.
Copilot AI lite review requested due to automatic review settings September 18, 2026 20:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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
philljj merged commit edbe117 into wolfSSL:master Sep 18, 2026
187 checks passed
@ejohnstown
ejohnstown deleted the zephyr-zsock-names branch September 18, 2026 22:30
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.

4 participants