Skip to content

Commit

Permalink
interfaces: fix lock vs. non-lock priority in loop
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Aug 7, 2017
1 parent dc53c74 commit f22ade5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/etc/inc/console.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f22ade5

Please sign in to comment.