Add the missing lock.

This commit is contained in:
christos 2018-04-11 18:34:18 +00:00
parent d0c4b2c3b3
commit 0c6b6224b4

View File

@ -48,6 +48,7 @@ extern int daemon(int, int);
#include "mDNSUNP.h" // For daemon() #include "mDNSUNP.h" // For daemon()
#include "uds_daemon.h" #include "uds_daemon.h"
#include "PlatformCommon.h" #include "PlatformCommon.h"
#include "DNSCommon.h"
#define CONFIG_FILE "/etc/mdnsd.conf" #define CONFIG_FILE "/etc/mdnsd.conf"
static domainname DynDNSZone; // Default wide-area zone for service registration static domainname DynDNSZone; // Default wide-area zone for service registration
@ -89,8 +90,10 @@ static void Reconfigure(mDNS *m)
mDNSAddr DynDNSIP; mDNSAddr DynDNSIP;
const mDNSAddr dummy = { mDNSAddrType_IPv4, { { { 1, 1, 1, 1 } } } };; const mDNSAddr dummy = { mDNSAddrType_IPv4, { { { 1, 1, 1, 1 } } } };;
mDNS_SetPrimaryInterfaceInfo(m, NULL, NULL, NULL); mDNS_SetPrimaryInterfaceInfo(m, NULL, NULL, NULL);
mDNS_Lock(m);
if (ParseDNSServers(m, uDNS_SERVERS_FILE) < 0) if (ParseDNSServers(m, uDNS_SERVERS_FILE) < 0)
LogMsg("Unable to parse DNS server list. Unicast DNS-SD unavailable"); LogMsg("Unable to parse DNS server list. Unicast DNS-SD unavailable");
mDNS_Unlock(m);
ReadDDNSSettingsFromConfFile(m, CONFIG_FILE, &DynDNSHostname, &DynDNSZone, NULL); ReadDDNSSettingsFromConfFile(m, CONFIG_FILE, &DynDNSHostname, &DynDNSZone, NULL);
mDNSPlatformSourceAddrForDest(&DynDNSIP, &dummy); mDNSPlatformSourceAddrForDest(&DynDNSIP, &dummy);
if (DynDNSHostname.c[0]) mDNS_AddDynDNSHostName(m, &DynDNSHostname, NULL, NULL); if (DynDNSHostname.c[0]) mDNS_AddDynDNSHostName(m, &DynDNSHostname, NULL, NULL);