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 2/6] alfred: update stored interface list on interface change
Date: Fri, 31 Jul 2026 13:44:51 +0200 [thread overview]
Message-ID: <20260731-bugfixes-interfaces-v1-2-a148ca2f6688@narfation.org> (raw)
In-Reply-To: <20260731-bugfixes-interfaces-v1-0-a148ca2f6688@narfation.org>
The interface list received via ALFRED_CHANGE_INTERFACE was passed to
netsock_set_interfaces() but globals->net_iface kept the value from the
daemon start. But the stale string is used by unix_sock_add_data() to
decide whether interface operations are disabled ('none'). And for the none
interface, it is required to be in primary mode and to prefill the
data->source address.
Store a copy of the new interface list in globals->net_iface to dynamically
switch between the disabled/not disabled mode.
Fixes: 94b3c4b5744f ("alfred: receive data with valid source on unix sock without active interface")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
unix_sock.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/unix_sock.c b/unix_sock.c
index e6b44da..64fde70 100644
--- a/unix_sock.c
+++ b/unix_sock.c
@@ -365,6 +365,7 @@ unix_sock_change_iface(struct globals *globals,
struct alfred_change_interface_v0 *change_iface,
int client_sock)
{
+ char *net_iface;
int ret = -1;
int len;
@@ -383,6 +384,13 @@ unix_sock_change_iface(struct globals *globals,
}
}
+ net_iface = strdup(change_iface->ifaces);
+ if (!net_iface)
+ goto err;
+
+ free(globals->net_iface);
+ globals->net_iface = net_iface;
+
netsock_set_interfaces(globals, change_iface->ifaces);
ret = 0;
--
2.47.3
next prev parent reply other threads:[~2026-07-31 11:46 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 ` Sven Eckelmann [this message]
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 ` [PATCH 6/6] alfred: don't check the "none" on network interface change 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-interfaces-v1-2-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.