From d4f4b48b0692efbbbccbb79e3651b50227eb65c5 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 11 Mar 2022 11:09:55 +0100 Subject: [PATCH] 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. --- src/etc/inc/system.inc | 5 +++++ src/etc/inc/util.inc | 10 ---------- src/etc/rc.bootup | 1 - src/www/system_general.php | 1 - 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc index 9db64e5d5..5030b9287 100644 --- a/src/etc/inc/system.inc +++ b/src/etc/inc/system.inc @@ -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']; diff --git a/src/etc/inc/util.inc b/src/etc/inc/util.inc index 0f6d583d9..4440445c9 100644 --- a/src/etc/inc/util.inc +++ b/src/etc/inc/util.inc @@ -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; diff --git a/src/etc/rc.bootup b/src/etc/rc.bootup index bddabc2e7..ab1749564 100755 --- a/src/etc/rc.bootup +++ b/src/etc/rc.bootup @@ -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); diff --git a/src/www/system_general.php b/src/www/system_general.php index 8a666f151..44b1645b3 100644 --- a/src/www/system_general.php +++ b/src/www/system_general.php @@ -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();