B.A.T.M.A.N Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: Sven Eckelmann <sven@narfation.org>
Subject: [PATCH 1/4] alfred: fix error code from unix_sock_req_data_reply
Date: Fri, 31 Jul 2026 09:40:13 +0200	[thread overview]
Message-ID: <20260731-bugfixes-client-v1-1-83d8c7a26421@narfation.org> (raw)
In-Reply-To: <20260731-bugfixes-client-v1-0-83d8c7a26421@narfation.org>

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 <sven@narfation.org>
---
 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


  reply	other threads:[~2026-07-31  7:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-31  7:40 [PATCH 0/4] alfred: client: random fixes Sven Eckelmann
2026-07-31  7:40 ` Sven Eckelmann [this message]
2026-07-31  7:40 ` [PATCH 2/4] alfred: avoid endless-loop when reading data from stdin fails Sven Eckelmann
2026-07-31  7:40 ` [PATCH 3/4] alfred: close the listening socket on daemon setup errors Sven Eckelmann
2026-07-31  7:40 ` [PATCH 4/4] alfred: handle short reads when waiting for daemon answer Sven Eckelmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260731-bugfixes-client-v1-1-83d8c7a26421@narfation.org \
    --to=sven@narfation.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox