From ff568b4abfc7a302c2cd96680292463a53aed673 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 22 Aug 2016 08:41:09 +0200 Subject: [PATCH] system: kill default gateway force override; closes #957 While we don't exactly know how this pans out, it's code that needs to be inspected by forcing it to -devel for a while. As far as I can see, the following applies: When there are no gateways, they are generated as defaults. When they are edited, they stay in the config and their e.g. choice of being disabled should be honoured. --- src/etc/inc/gwlb.inc | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/etc/inc/gwlb.inc b/src/etc/inc/gwlb.inc index 5a3e14698..213deee52 100644 --- a/src/etc/inc/gwlb.inc +++ b/src/etc/inc/gwlb.inc @@ -774,27 +774,6 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive } unset($gateway); - /* FIXME: Should this be enabled. - * Some interface like wan might be default but have no info recorded - * the config. */ - /* this is a fallback if all else fails and we want to get packets out @smos */ - if ($found_defaultv4 == 0 || $found_defaultv6 == 0) { - foreach ($gateways_arr as &$gateway) { - if (($gateway['friendlyiface'] == "wan") && ($found_defaultv4 == 0) && (!isset($gateway['ipprotocol']) || ($gateway['ipprotocol'] == "inet"))) { - if (file_exists("/tmp/{$gateway['interface']}_defaultgw")) { - $gateway['defaultgw'] = true; - $found_defaultv4 = 1; - } - } - if (($gateway['friendlyiface'] == "wan") && ($found_defaultv6 == 0) && ($gateway['ipprotocol'] == "inet6")) { - if (file_exists("/tmp/{$gateway['interface']}_defaultgwv6")) { - $gateway['defaultgw'] = true; - $found_defaultv6 = 1; - } - } - } - } - if ($localhost === true) { /* attach localhost for Null routes */ $gwlo4 = array(); @@ -810,6 +789,7 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive $gateways_arr['Null4'] = $gwlo4; $gateways_arr['Null6'] = $gwlo6; } + return($gateways_arr); }