Commit c5cd4b78 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

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

(cherry picked from commit ce8ef993)
parent 17dc44a7
...@@ -739,14 +739,16 @@ function fixup_default_gateway($gateways_status, $gateways_arr) ...@@ -739,14 +739,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