1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-06-13 18:53:52 +02:00

dnsmasq: mark global ubus context as closed after fork

If the dnsmasq process forks to handle TCP connections, it closes the ubus
context. But instead of changing the daemon wide pointer to NULL, only the
local variable was adjusted - and this portion of the code was even dropped
(dead store) by some optimizing compilers.

It makes more sense to change the daemon->ubus pointer because various
functions are already checking it for NULL. It is also the behavior which
ubus_destroy() implements.

Fixes: d8b33dad0b ("dnsmasq: add support for monitoring and modifying dns lookup results via ubus")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
(cherry picked from commit 711dcb7763)
This commit is contained in:
Sven Eckelmann 2023-11-18 16:29:09 +01:00 committed by Hauke Mehrtens
parent 0a571c9e77
commit af22a169c1

View File

@ -210,7 +210,7 @@
+ return;
+
+ ubus_free(ubus);
+ ubus = NULL;
+ daemon->ubus = NULL;
+}
+
static int ubus_handle_metrics(struct ubus_context *ctx, struct ubus_object *obj,