All of 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 6/6] alfred: don't check the "none" on network interface change
Date: Fri, 31 Jul 2026 13:44:55 +0200	[thread overview]
Message-ID: <20260731-bugfixes-interfaces-v1-6-a148ca2f6688@narfation.org> (raw)
In-Reply-To: <20260731-bugfixes-interfaces-v1-0-a148ca2f6688@narfation.org>

The interface name 'none' disables all network interface operations of the
server. It is accepted by the -i parameter and by netsock_set_interfaces()
but the client tested every name of the -I list before sending the request.
The lookup of 'none' always fails with ENODEV and thus the request was
never sent.

Skip the interface check for the sentinel to ensure the network interface
can also be disabled at runtime.

Fixes: 2cca53171180 ("alfred: Allow operating without any interface specified")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 client.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/client.c b/client.c
index d25e3bb..06de0c4 100644
--- a/client.c
+++ b/client.c
@@ -281,15 +281,20 @@ int alfred_client_change_interface(struct globals *globals)
 	/* test it before sending
 	 * globals->net_iface is now saved in change_interface.ifaces
 	 * and can be modified by strtok_r
+	 *
+	 * the interface 'none' disables all interface operations and is not
+	 * an interface which could be looked up
 	 */
-	input = globals->net_iface;
-	while ((token = strtok_r(input, ",", &saveptr))) {
-		input = NULL;
+	if (!is_iface_disabled(globals->net_iface)) {
+		input = globals->net_iface;
+		while ((token = strtok_r(input, ",", &saveptr))) {
+			input = NULL;
 
-		ret = check_interface(token);
-		if (ret < 0) {
-			unix_sock_close(globals);
-			return -1;
+			ret = check_interface(token);
+			if (ret < 0) {
+				unix_sock_close(globals);
+				return -1;
+			}
 		}
 	}
 

-- 
2.47.3


      parent reply	other threads:[~2026-07-31 11:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-31 11:44 [PATCH 0/6] alfred: interfaces: random fixes Sven Eckelmann
2026-07-31 11:44 ` [PATCH 1/6] alfred: fix off-by-one in client interface name length checks Sven Eckelmann
2026-07-31 11:44 ` [PATCH 2/6] alfred: update stored interface list on interface change Sven Eckelmann
2026-07-31 11:44 ` [PATCH 3/6] alfred: don't drop the mesh interface name on OOM Sven Eckelmann
2026-07-31 11:44 ` [PATCH 4/6] alfred: keep the running interfaces when reconfiguration fails Sven Eckelmann
2026-07-31 11:44 ` [PATCH 5/6] alfred: Report failure when the client refuses to change interfaces Sven Eckelmann
2026-07-31 11:44 ` Sven Eckelmann [this message]

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-interfaces-v1-6-a148ca2f6688@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.