mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-18 18:44:44 +00:00
system: fix static gatway wizard handing; closes #3873
Mismatched our automatic gateway naming, assumed IPv6 on IPv4 and did not disable monitor by default as we recommend.
This commit is contained in:
parent
8d490c999b
commit
11017fa4ab
@ -168,6 +168,10 @@ class Gateways
|
||||
// default priority
|
||||
$gw_arr['priority'] = 255;
|
||||
}
|
||||
if (empty($gw_arr['ipprotocol'])) {
|
||||
// default address family
|
||||
$gw_arr['ipprotocol'] = 'inet';
|
||||
}
|
||||
$gw_arr["if"] = $definedIntf[$gw_arr["interface"]]['if'];
|
||||
$gw_arr["attribute"] = $i++;
|
||||
if (Util::isIpAddress($gateway->gateway)) {
|
||||
|
||||
@ -425,7 +425,7 @@ if (!empty($input_errors)) {
|
||||
<stepbeforeformdisplay><![CDATA[
|
||||
if (isset($config['gateways']['gateway_item'])) {
|
||||
foreach ($config['gateways']['gateway_item'] as $gw) {
|
||||
if ($gw['name'] == 'WANGW' || (!empty($config['wizardtemp']['wangateway']) && $gw['gateway'] == $config['wizardtemp']['wangateway'])) {
|
||||
if ($gw['name'] == 'WAN_GW' || (!empty($config['wizardtemp']['wangateway']) && $gw['gateway'] == $config['wizardtemp']['wangateway'])) {
|
||||
$config['wizardtemp']['wangateway'] = $gw['gateway'];
|
||||
}
|
||||
}
|
||||
@ -619,7 +619,7 @@ if (!empty($config['wizardtemp']['wangateway'])) {
|
||||
continue;
|
||||
if (isset($gw['defaultgw']))
|
||||
$defaultgw_found = true;
|
||||
if ($gw['name'] == 'WANGW' || (!empty($config['wizardtemp']['wangateway']) && $gw['gateway'] == $config['wizardtemp']['wangateway'])) {
|
||||
if ($gw['name'] == 'WAN_GW' || (!empty($config['wizardtemp']['wangateway']) && $gw['gateway'] == $config['wizardtemp']['wangateway'])) {
|
||||
$found = true;
|
||||
$gw['gateway'] = $config['wizardtemp']['wangateway'];
|
||||
$config['interfaces']['wan']['gateway'] = $gw['name'];
|
||||
@ -629,12 +629,13 @@ if (!empty($config['wizardtemp']['wangateway'])) {
|
||||
$newgw = array();
|
||||
$newgw['interface'] = "wan";
|
||||
$newgw['gateway'] = $config['wizardtemp']['wangateway'];
|
||||
$newgw['name'] = "WANGW";
|
||||
$newgw['name'] = 'WAN_GW';
|
||||
$newgw['weight'] = 1;
|
||||
$newgw['monitor_disable'] = 1;
|
||||
$newgw['descr'] = "WAN Gateway";
|
||||
$newgw['defaultgw'] = !$defaultgw_found;
|
||||
$config['gateways']['gateway_item'][] = $newgw;
|
||||
$config['interfaces']['wan']['gateway'] = "WANGW";
|
||||
$config['interfaces']['wan']['gateway'] = 'WAN_GW';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user