Commit ce8ef993 authored by Ad Schellevis's avatar Ad Schellevis

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

parent 9d239330
...@@ -738,14 +738,16 @@ function fixup_default_gateway($gateways_status, $gateways_arr) ...@@ -738,14 +738,16 @@ function fixup_default_gateway($gateways_status, $gateways_arr)
if (empty($upgw) && $gwsttng[$gwname]['friendlyiface'] != "lan" && if (empty($upgw) && $gwsttng[$gwname]['friendlyiface'] != "lan" &&
(isset($gwsttng['monitor_disable']) || !stristr($gateways_status[$gwname]['status'], "down"))) { (isset($gwsttng['monitor_disable']) || !stristr($gateways_status[$gwname]['status'], "down"))) {
$upgw = $gwname; $upgw = $gwname;
} if (!$dfltgwup) {
if (!$dfltgwup && !empty($upgw)) { break;
// switch gateway }
$dfltgwname = $upgw;
break;
} }
} }
} }
if (!$dfltgwup && !empty($upgw)) {
// switch gateway
$dfltgwname = $upgw;
}
if ($gateways_arr[$dfltgwname]['gateway'] == "dynamic") { if ($gateways_arr[$dfltgwname]['gateway'] == "dynamic") {
if ($ipprotocol == 'inet') { if ($ipprotocol == 'inet') {
$gwip = get_interface_gateway($gateways_arr[$dfltgwname]['friendlyiface']); $gwip = get_interface_gateway($gateways_arr[$dfltgwname]['friendlyiface']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment