[PATCH 1/4] alfred: fix error code from unix_sock_req_data_reply

Sven Eckelmann <[email protected]> Fri, 31 Jul 2026 09:40:13 +0200
Newsgroups org.open-mesh.lists.batman
Message-ID <[email protected]>
The error code of unix_sock_req_data_reply() was stored in an uint16_t
before being returned from the int-returning function. A failed write to
the client socket therefore returned 65535 instead of -1.

Fixes: 4a77be458853 ("alfred: handle failing write() in unix sockets")
Signed-off-by: Sven Eckelmann <[email protected]>
---
 unix_sock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/unix_sock.c b/unix_sock.c
index e6b44da..e24c788 100644
--- a/unix_sock.c
+++ b/unix_sock.c
@@ -207,7 +207,7 @@ static int unix_sock_req_data_reply(struct globals *globals, int client_sock,
 	struct hash_it_t *hashit = NULL;
 	uint8_t buf[MAX_PAYLOAD];
 	uint16_t seqno = 0;
-	uint16_t ret = 0;
+	int ret = 0;
 	int len;
 
 	/* send some data back through the unix socket */

-- 
2.47.3