diff --git a/src/etc/inc/gwlb.inc b/src/etc/inc/gwlb.inc index d4d67035f..6e7472b3f 100644 --- a/src/etc/inc/gwlb.inc +++ b/src/etc/inc/gwlb.inc @@ -770,8 +770,7 @@ function fixup_default_gateway($gateways_status, $gateways_arr) continue; } - /* switch only if another gateway is set aa the default */ - system_default_route($dfltgwip, $ipprotocol, $gateways_arr[$dfltgwname]['friendlyiface'], isset($gateways_arr[$dfltgwname]['fargw']), true); + system_default_route($dfltgwip, $ipprotocol, $gateways_arr[$dfltgwname]['friendlyiface'], isset($gateways_arr[$dfltgwname]['fargw'])); } } diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc index 216b900a6..b7269af6c 100644 --- a/src/etc/inc/system.inc +++ b/src/etc/inc/system.inc @@ -417,7 +417,7 @@ function system_host_route($host, $gateway, $delete = true, $add = true) } } -function system_default_route($gateway, $family, $interface, $far = false, $keep = false) +function system_default_route($gateway, $family, $interface, $far = false, $keep = true) { $realif = get_real_interface($interface); @@ -434,6 +434,7 @@ function system_default_route($gateway, $family, $interface, $far = false, $keep return; } + /* XXX we can hardcode this as soon as testing goes ok */ if ($keep) { $tmpcmd = "/sbin/route -n get -{$family} default 2>/dev/null | /usr/bin/awk '/gateway:/ {print $2}'"; $current = trim(exec($tmpcmd), " \n");