netconfig: Don't load settings in netconfig_new

Move the l_netconfig_set_route_priority() and
l_netconfig_set_optimistic_dad_enabled() calls from netconfig_new, which
is called once for the l_netconfig object's lifetime, to
netconfig_load_settings, which is called before every connection attempt.
This is needed because we clean up the l_netconfig configuration by calling
l_netconfig_reset_config() at different points in connection setup and
teardown so we'd reset the route priority that we've set in netconfig_new,
back to 0 and never reload it.
This commit is contained in:
Andrew Zaborowski 2022-12-22 03:41:43 +01:00 committed by Denis Kenzior
parent 2ba0ad212e
commit 14290e0b9a
1 changed files with 5 additions and 5 deletions

View File

@ -413,7 +413,7 @@ mdns:
}
if (!success)
goto check_config;
goto route_priority;
}
if (!mdns && mdns_global) {
@ -426,7 +426,10 @@ mdns:
}
}
check_config:
route_priority:
l_netconfig_set_route_priority(netconfig->nc, ROUTE_PRIORITY_OFFSET);
l_netconfig_set_optimistic_dad_enabled(netconfig->nc, true);
if (!l_netconfig_check_config(netconfig->nc)) {
l_error("netconfig: Invalid configuration");
success = false;
@ -734,9 +737,6 @@ struct netconfig *netconfig_new(uint32_t ifindex)
l_icmp6_client_set_debug(icmp6, do_debug, "[ICMPv6] ", NULL);
}
l_netconfig_set_route_priority(netconfig->nc, ROUTE_PRIORITY_OFFSET);
l_netconfig_set_optimistic_dad_enabled(netconfig->nc, true);
return netconfig;
}