Message ID | 20231118-dnsmasq_drop_ubus_null-v1-1-a84754bd5c91@narfation.org |
---|---|
State | Superseded |
Delegated to: | Hauke Mehrtens |
Headers | show |
Series | dnsmasq: mark global ubus context as closed after fork | expand |
The sender domain has a DMARC Reject/Quarantine policy which disallows sending mailing list messages using the original "From" header. To mitigate this problem, the original message has been wrapped automatically by the mailing list software. On Saturday, November 18th, 2023 at 06:49, Sven Eckelmann <sven@narfation.org> wrote: > 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 changed - and this code portion was even dropped as > dead-store by some optimizing compilers. > > It makes more sense to change the daemon->ubus pointer to NULL because > > various functions are already it for NULL. It is also the behavior which "already *checking* it"? > ubus_destroy() implements. > > Fixes: d8b33dad0bb7 ("dnsmasq: add support for monitoring and modifying dns lookup results via ubus") > Signed-off-by: Sven Eckelmann sven@narfation.org > > --- > package/network/services/dnsmasq/patches/200-ubus_dns.patch | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/package/network/services/dnsmasq/patches/200-ubus_dns.patch b/package/network/services/dnsmasq/patches/200-ubus_dns.patch > index 8a70bb8bdf..ccbe70ab9c 100644 > --- a/package/network/services/dnsmasq/patches/200-ubus_dns.patch > +++ b/package/network/services/dnsmasq/patches/200-ubus_dns.patch > @@ -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, > > --- > base-commit: 9062e5faaedc03823ee419fe34de1de73f48babc > change-id: 20231118-dnsmasq_drop_ubus_null-ae5b5f062cb7 > > Best regards, > -- > Sven Eckelmann sven@narfation.org
diff --git a/package/network/services/dnsmasq/patches/200-ubus_dns.patch b/package/network/services/dnsmasq/patches/200-ubus_dns.patch index 8a70bb8bdf..ccbe70ab9c 100644 --- a/package/network/services/dnsmasq/patches/200-ubus_dns.patch +++ b/package/network/services/dnsmasq/patches/200-ubus_dns.patch @@ -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,
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 changed - and this code portion was even dropped as dead-store by some optimizing compilers. It makes more sense to change the daemon->ubus pointer to NULL because various functions are already it for NULL. It is also the behavior which ubus_destroy() implements. Fixes: d8b33dad0bb7 ("dnsmasq: add support for monitoring and modifying dns lookup results via ubus") Signed-off-by: Sven Eckelmann <sven@narfation.org> --- package/network/services/dnsmasq/patches/200-ubus_dns.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- base-commit: 9062e5faaedc03823ee419fe34de1de73f48babc change-id: 20231118-dnsmasq_drop_ubus_null-ae5b5f062cb7 Best regards,