From f22ade58db050a64f0f6e412bdb91d8e7de2a2de Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 7 Aug 2017 06:19:45 +0200 Subject: [PATCH] interfaces: fix lock vs. non-lock priority in loop --- src/etc/inc/console.inc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/etc/inc/console.inc b/src/etc/inc/console.inc index 16ae57a34..697413bc2 100644 --- a/src/etc/inc/console.inc +++ b/src/etc/inc/console.inc @@ -50,19 +50,23 @@ function timeout($timer = 5) function is_interface_mismatch() { + $mismatch = false; + foreach (legacy_config_get_interfaces(array("virtual" => false)) as $ifname => $ifcfg) { if (!empty($ifcfg['lock'])) { /* Do not mismatch if any lock was issued */ + $mismatch = false; break; } elseif (preg_match("/^enc|^cua|^tun|^tap|^l2tp|^pptp|^ppp|^ovpn|^tinc|^gif|^gre|^lagg|^bridge|vlan|_wlan/i", $ifcfg['if'])) { /* Do not check these interfaces */ continue; } elseif (does_interface_exist($ifcfg['if']) == false) { - return true; + /* Continue loop, may still find a lock */ + $mismatch = true; } } - return false; + return $mismatch; } function set_networking_interfaces_ports($probe = false)