system: prefer address family earlier on boot

Looking for things that could go wrong with root.key in Unbound
this could be one of those.  Still, at this point we may not have
received DNS servers from the ISP since these are registered much
later (10-newwanip).

Great opportunity to ditch prefer_ipv4_or_ipv6() since we need it
for resolving which we set up alongside and in the right spot.
This commit is contained in:
Franco Fichtner 2022-03-11 11:09:55 +01:00
parent 6446a4ccfa
commit d4f4b48b06
4 changed files with 5 additions and 12 deletions

View File

@ -180,6 +180,11 @@ function system_resolvconf_generate($verbose = false)
$search = [];
$routes = [];
mwexecf(
'/etc/rc.d/ip6addrctl %s',
isset($syscfg['prefer_ipv4']) ? 'prefer_ipv4' : 'prefer_ipv6'
);
if (!empty($syscfg['domain'])) {
$resolvconf = "domain {$syscfg['domain']}\n";
$search[] = $syscfg['domain'];

View File

@ -1290,16 +1290,6 @@ function get_staticroutes($returnsubnetsonly = false)
return $allstaticroutes;
}
function prefer_ipv4_or_ipv6()
{
global $config;
mwexecf(
'/etc/rc.d/ip6addrctl %s',
isset($config['system']['prefer_ipv4']) ? 'prefer_ipv4' : 'prefer_ipv6'
);
}
function is_fqdn($fqdn)
{
$hostname = false;

View File

@ -100,7 +100,6 @@ plugins_configure('dhcp', true);
plugins_configure('dhcrelay', true);
plugins_configure('dns', true);
prefer_ipv4_or_ipv6();
plugins_configure('monitor', true);
filter_configure_sync(true);
plugins_configure('vpn', true);

View File

@ -228,7 +228,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
system_timezone_configure();
system_trust_configure();
prefer_ipv4_or_ipv6();
system_hostname_configure();
system_hosts_generate();
system_resolvconf_generate();