gwlb, gateway switch shouldn't be in the for loop

This commit is contained in:
Ad Schellevis 2017-05-08 08:44:52 +02:00
parent 9d239330db
commit ce8ef9930b

View File

@ -738,14 +738,16 @@ function fixup_default_gateway($gateways_status, $gateways_arr)
if (empty($upgw) && $gwsttng[$gwname]['friendlyiface'] != "lan" &&
(isset($gwsttng['monitor_disable']) || !stristr($gateways_status[$gwname]['status'], "down"))) {
$upgw = $gwname;
}
if (!$dfltgwup && !empty($upgw)) {
// switch gateway
$dfltgwname = $upgw;
break;
if (!$dfltgwup) {
break;
}
}
}
}
if (!$dfltgwup && !empty($upgw)) {
// switch gateway
$dfltgwname = $upgw;
}
if ($gateways_arr[$dfltgwname]['gateway'] == "dynamic") {
if ($ipprotocol == 'inet') {
$gwip = get_interface_gateway($gateways_arr[$dfltgwname]['friendlyiface']);