Skip to content

Commit

Permalink
gwlb, gateway switch shouldn't be in the for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
AdSchellevis committed May 8, 2017
1 parent 9d23933 commit ce8ef99
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/etc/inc/gwlb.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down

0 comments on commit ce8ef99

Please sign in to comment.