summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau2026-02-07 08:02:24 +0000
committerFelix Fietkau2026-02-16 08:09:16 +0000
commit40a7b55d70681db008427c11cfad56e3c78908c9 (patch)
treedfaa9c9a192734f7f701c861ce4622607708e183
parent41ec0c16a7eb2a07666850cfa9062f4535b67e0d (diff)
downloadopenwrt-40a7b55d70681db008427c11cfad56e3c78908c9.tar.gz
unetmsg: only send publish notifications for remote publisher changes
handle_publish() notifies local subscribers about publisher state changes. The publish/subscribe handler in network_socket_handle_request() was calling it for both remote publish and subscribe changes, but subscriber changes are not relevant to local subscribers. Guard the handle_publish() calls with a msgtype == "publish" check, matching the local client paths in unetmsgd-client.uc which already have this guard. Signed-off-by: Felix Fietkau <nbd@nbd.name> (cherry picked from commit e0722d0ac41b931e8a3b79c439a029844e89cbad)
-rw-r--r--package/network/services/unetmsg/files/usr/share/ucode/unetmsg/unetmsgd-remote.uc7
1 files changed, 4 insertions, 3 deletions
diff --git a/package/network/services/unetmsg/files/usr/share/ucode/unetmsg/unetmsgd-remote.uc b/package/network/services/unetmsg/files/usr/share/ucode/unetmsg/unetmsgd-remote.uc
index c7301e1a09..e5f1b7fb5f 100644
--- a/package/network/services/unetmsg/files/usr/share/ucode/unetmsg/unetmsgd-remote.uc
+++ b/package/network/services/unetmsg/files/usr/share/ucode/unetmsg/unetmsgd-remote.uc
@@ -104,7 +104,7 @@ function network_socket_handle_request(sock_data, req)
return;
if (args.enabled) {
if (list[name]) {
- if (tx_auth)
+ if (tx_auth && msgtype == "publish")
core.handle_publish(null, name);
return 0;
}
@@ -124,13 +124,14 @@ function network_socket_handle_request(sock_data, req)
network: sock_data.network,
name: host,
}, pubsub_proto);
- if (tx_auth)
+ if (tx_auth && msgtype == "publish")
core.handle_publish(null, name);
list[name] = true;
} else {
if (!list[name])
return 0;
- core.handle_publish(null, name);
+ if (msgtype == "publish")
+ core.handle_publish(null, name);
delete core["remote_" + msgtype][name][host];
delete list[name];
}