75 |
75 |
$pconfig['dynamic'] = true;
|
76 |
76 |
$pconfig['gateway'] = $a_gateways[$id]['gateway'];
|
77 |
77 |
$pconfig['defaultgw'] = isset($a_gateways[$id]['defaultgw']);
|
78 |
|
$pconfig['latencylow'] = $a_gateway_item[$id]['latencylow'];
|
79 |
|
$pconfig['latencyhigh'] = $a_gateway_item[$id]['latencyhigh'];
|
80 |
|
$pconfig['losslow'] = $a_gateway_item[$id]['losslow'];
|
81 |
|
$pconfig['losshigh'] = $a_gateway_item[$id]['losshigh'];
|
82 |
|
$pconfig['down'] = $a_gateway_item[$id]['down'];
|
|
78 |
$pconfig['latencylow'] = $a_gateways[$id]['latencylow'];
|
|
79 |
$pconfig['latencyhigh'] = $a_gateways[$id]['latencyhigh'];
|
|
80 |
$pconfig['losslow'] = $a_gateways[$id]['losslow'];
|
|
81 |
$pconfig['losshigh'] = $a_gateways[$id]['losshigh'];
|
|
82 |
$pconfig['down'] = $a_gateways[$id]['down'];
|
83 |
83 |
$pconfig['monitor'] = $a_gateways[$id]['monitor'];
|
84 |
84 |
$pconfig['monitor_disable'] = isset($a_gateways[$id]['monitor_disable']);
|
85 |
85 |
$pconfig['descr'] = $a_gateways[$id]['descr'];
|
... | ... | |
91 |
91 |
unset($pconfig['attribute']);
|
92 |
92 |
}
|
93 |
93 |
|
|
94 |
if (isset($id) && $a_gateways[$id])
|
|
95 |
$realid = $a_gateways[$id]['attribute'];
|
|
96 |
|
94 |
97 |
if ($_POST) {
|
95 |
98 |
|
96 |
99 |
unset($input_errors);
|
... | ... | |
386 |
389 |
$gateway['monitor_disable'] = true;
|
387 |
390 |
else if (is_ipaddr($_POST['monitor'])) {
|
388 |
391 |
/* NOTE: If monitor ip is changed need to cleanup the old static route */
|
389 |
|
if ($_POST['monitor'] != "dynamic" && !empty($a_gateway_item[$id]) && is_ipaddr($a_gateway_item[$id]['monitor']) &&
|
390 |
|
$_POST['monitor'] != $a_gateway_item[$id]['monitor'] && $gateway['gateway'] != $a_gateway_item[$id]['monitor']) {
|
391 |
|
if (is_ipaddrv4($a_gateway_item[$id]['monitor']))
|
392 |
|
mwexec("/sbin/route delete " . escapeshellarg($a_gateway_item[$id]['monitor']));
|
|
392 |
if ($_POST['monitor'] != "dynamic" && !empty($a_gateway_item[$realid]) && is_ipaddr($a_gateway_item[$realid]['monitor']) &&
|
|
393 |
$_POST['monitor'] != $a_gateway_item[$realid]['monitor'] && $gateway['gateway'] != $a_gateway_item[$realid]['monitor']) {
|
|
394 |
if (is_ipaddrv4($a_gateway_item[$realid]['monitor']))
|
|
395 |
mwexec("/sbin/route delete " . escapeshellarg($a_gateway_item[$realid]['monitor']));
|
393 |
396 |
else
|
394 |
|
mwexec("/sbin/route delete -inet6 " . escapeshellarg($a_gateway_item[$id]['monitor']));
|
|
397 |
mwexec("/sbin/route delete -inet6 " . escapeshellarg($a_gateway_item[$realid]['monitor']));
|
395 |
398 |
}
|
396 |
399 |
$gateway['monitor'] = $_POST['monitor'];
|
397 |
400 |
}
|
... | ... | |
422 |
425 |
$gateway['down'] = $_POST['down'];
|
423 |
426 |
|
424 |
427 |
/* when saving the manual gateway we use the attribute which has the corresponding id */
|
425 |
|
if (isset($id) && $a_gateway_item[$id])
|
426 |
|
$a_gateway_item[$id] = $gateway;
|
|
428 |
if (isset($realid) && $a_gateway_item[$realid])
|
|
429 |
$a_gateway_item[$realid] = $gateway;
|
427 |
430 |
else
|
428 |
431 |
$a_gateway_item[] = $gateway;
|
429 |
432 |
|
Fix an issue that changes wrong gateway entry when items are hidden