[Dnsmasq-discuss] [PATCH] Do not crash when Ubus connection fails.

Etan Kissling etan.kissling at gmail.com
Sat Jun 26 23:22:16 UTC 2021


When using multiple dnsmasq instances Ubus only connects on one of them.
Since 3c93e8eb41952a9c91699386132d6fe83050e9be dnsmasq crashes instead.
This change avoids the crash, leading to a graceful retry + error log.

Signed-off-by: Etan Kissling <etan.kissling at gmail.com>
---
 src/dnsmasq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/dnsmasq.c b/src/dnsmasq.c
index 04582da..2b4291b 100644
--- a/src/dnsmasq.c
+++ b/src/dnsmasq.c
@@ -449,10 +449,8 @@ int main (int argc, char **argv)
   if (option_bool(OPT_UBUS))
 #ifdef HAVE_UBUS
     {
-      char *err;
       daemon->ubus = NULL;
-      if ((err = ubus_init()))
-	die(_("UBus error: %s"), err, EC_MISC);
+      (void) ubus_init(); /* Logging not set up yet. */
     }
 #else
   die(_("UBus not available: set HAVE_UBUS in src/config.h"), NULL, EC_BADCONF);
-- 
2.30.1 (Apple Git-130)




More information about the Dnsmasq-discuss mailing list