mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 09:34:39 +00:00
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.
This commit is contained in:
parent
54ec648734
commit
ff568b4abf
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user