From f43bdcf464d082df0ba273931e76faab81042dfb Mon Sep 17 00:00:00 2001 From: John Safranek Date: Fri, 18 Sep 2026 13:46:35 -0700 Subject: [PATCH] io.c: use the zsock names on Zephyr 4.1 and newer Zephyr 4.1 dropped CONFIG_NET_SOCKETS_POSIX_NAMES, and from 4.4 the POSIX aliases in 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 for the test. --- src/io.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/io.c b/src/io.c index ffe8e2fdf..563cc8c25 100644 --- a/src/io.c +++ b/src/io.c @@ -142,6 +142,7 @@ void* wolfSSH_GetIOWriteCtx(WOLFSSH* ssh) #include #elif defined(WOLFSSH_ZEPHYR) #include + #include #else #include #include @@ -258,6 +259,15 @@ void* wolfSSH_GetIOWriteCtx(WOLFSSH* ssh) #elif defined(WOLFSSL_NUCLEUS) #define SEND_FUNCTION NU_Send #define RECV_FUNCTION NU_Recv +#elif defined(WOLFSSH_ZEPHYR) + #if KERNEL_VERSION_NUMBER >= 0x40100 + /* Zephyr 4.1 dropped the POSIX socket names; zsock_ is always there. */ + #define SEND_FUNCTION zsock_send + #define RECV_FUNCTION zsock_recv + #else + #define SEND_FUNCTION send + #define RECV_FUNCTION recv + #endif #else #define SEND_FUNCTION send #define RECV_FUNCTION recv