Commit ff568b4a authored by Franco Fichtner's avatar Franco Fichtner

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.
parent 54ec6487
......@@ -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);
}
......
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