[PATCH 6/6] alfred: don't check the "none" on network interface change
Sven Eckelmann <[email protected]> Fri, 31 Jul 2026 13:44:55 +0200
| Newsgroups | org.open-mesh.lists.batman |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]>
---
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