From 461b7cf1f1e1e8fcd9702c532801e4d3515e2520 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Fri, 20 Mar 2026 13:53:36 +0800 Subject: [PATCH] system/fastboot: fix socket() parameter order for TCP transport SOCK_CLOEXEC and SOCK_NONBLOCK were incorrectly passed as the third argument (protocol) instead of being OR'd into the second argument (type). This caused socket() to fail with EPROTONOSUPPORT (errno 93) on NuttX. Move SOCK_CLOEXEC | SOCK_NONBLOCK to the type parameter and set protocol to 0. Signed-off-by: wangjianyu3 --- system/fastboot/fastboot.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/system/fastboot/fastboot.c b/system/fastboot/fastboot.c index 4ba39b5d3a5..d443bb9c879 100644 --- a/system/fastboot/fastboot.c +++ b/system/fastboot/fastboot.c @@ -1295,8 +1295,9 @@ static int fastboot_tcp_initialize(FAR struct fastboot_ctx_s *ctx) netinit_bringup(); #endif - ctx->tran_fd[0] = socket(AF_INET, SOCK_STREAM, - SOCK_CLOEXEC | SOCK_NONBLOCK); + ctx->tran_fd[0] = socket(AF_INET, + SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK, + 0); if (ctx->tran_fd[0] < 0) { fb_err("create socket failed %d", errno);