소스 검색

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: d8b33dad0bb7 ("dnsmasq: add support for monitoring and modifying dns lookup results via ubus")
Signed-off-by: Sven Eckelmann <[email protected]>
Sven Eckelmann 1 년 전
부모
커밋
711dcb7763
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      package/network/services/dnsmasq/patches/200-ubus_dns.patch

+ 1 - 1
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,