mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-25 17:49:37 +01:00
netconfig: add global MulticastDNS option
Adds the MulticastDNS option globally to main.conf. If set all network connections (when netconfig is enabled) will set mDNS support into the resolver. Note that an individual network profile can still override the global value if it sets MulticastDNS.
This commit is contained in:
parent
b9855f7d62
commit
c89c37378b
@ -56,6 +56,7 @@
|
|||||||
*/
|
*/
|
||||||
static uint32_t ROUTE_PRIORITY_OFFSET;
|
static uint32_t ROUTE_PRIORITY_OFFSET;
|
||||||
static bool ipv6_enabled;
|
static bool ipv6_enabled;
|
||||||
|
static char *mdns_global;
|
||||||
|
|
||||||
static void do_debug(const char *str, void *user_data)
|
static void do_debug(const char *str, void *user_data)
|
||||||
{
|
{
|
||||||
@ -396,19 +397,36 @@ send_hostname:
|
|||||||
}
|
}
|
||||||
|
|
||||||
mdns:
|
mdns:
|
||||||
if (l_settings_has_key(active_settings, "Network", "MulticastDNS") &&
|
/* If the networks has this set take that over the global */
|
||||||
!(mdns = l_settings_get_string(active_settings,
|
if (l_settings_has_key(active_settings, "Network", "MulticastDNS")) {
|
||||||
"Network",
|
mdns = l_settings_get_string(active_settings, "Network",
|
||||||
"MulticastDNS"))) {
|
"MulticastDNS");
|
||||||
l_error("netconfig: Can't load Network.MulticastDNS");
|
if (!mdns) {
|
||||||
success = false;
|
l_error("netconfig: Can't load Network.MulticastDNS");
|
||||||
|
success = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mdns && !L_IN_STRSET(mdns, "true", "false", "resolve")) {
|
||||||
|
l_error("netconfig: Bad profile Network.MulticastDNS "
|
||||||
|
"value '%s'", mdns);
|
||||||
|
success = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!success)
|
||||||
|
goto check_config;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mdns && !L_IN_STRSET(mdns, "true", "false", "resolve")) {
|
if (!mdns && mdns_global) {
|
||||||
l_error("netconfig: Bad Network.MulticastDNS value '%s'", mdns);
|
mdns = l_strdup(mdns_global);
|
||||||
success = false;
|
|
||||||
|
if (!L_IN_STRSET(mdns, "true", "false", "resolve")) {
|
||||||
|
l_error("netconfig: Bad global Network.MulticastDNS "
|
||||||
|
"value '%s'", mdns);
|
||||||
|
success = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_config:
|
||||||
if (!l_netconfig_check_config(netconfig->nc)) {
|
if (!l_netconfig_check_config(netconfig->nc)) {
|
||||||
l_error("netconfig: Invalid configuration");
|
l_error("netconfig: Invalid configuration");
|
||||||
success = false;
|
success = false;
|
||||||
@ -753,11 +771,15 @@ static int netconfig_init(void)
|
|||||||
&ipv6_enabled))
|
&ipv6_enabled))
|
||||||
ipv6_enabled = false;
|
ipv6_enabled = false;
|
||||||
|
|
||||||
|
mdns_global = l_settings_get_string(iwd_get_config(), "Network",
|
||||||
|
"MulticastDNS");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void netconfig_exit(void)
|
static void netconfig_exit(void)
|
||||||
{
|
{
|
||||||
|
l_free(mdns_global);
|
||||||
}
|
}
|
||||||
|
|
||||||
IWD_MODULE(netconfig, netconfig_init, netconfig_exit)
|
IWD_MODULE(netconfig, netconfig_init, netconfig_exit)
|
||||||
|
Loading…
Reference in New Issue
Block a user