mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-18 10:35:27 +00:00
interfaces: 6rd validation and avoid assignment #1501
This commit is contained in:
parent
893e9cf0f4
commit
cc2902e4dd
@ -679,6 +679,15 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
}
|
||||
break;
|
||||
case "6rd":
|
||||
if (empty($pconfig['gateway-6rd']) || !is_ipaddrv4($pconfig['gateway-6rd'])) {
|
||||
$input_errors[] = gettext('6RD border relay gateway must be a valid IPv4 address.');
|
||||
}
|
||||
if (empty($pconfig['prefix-6rd']) || !is_subnetv6($pconfig['prefix-6rd'])) {
|
||||
$input_errors[] = gettext('6RD prefix must be a valid IPv6 subnet.');
|
||||
}
|
||||
if (!is_numeric($pconfig['prefix-6rd-v4plen'])) {
|
||||
$input_errors[] = gettext('6RD IPv4 prefix length must be a number.');
|
||||
}
|
||||
foreach ($ifdescrs as $ifent => $ifdescr) {
|
||||
if ($if != $ifent && ($config[interfaces][$ifent]['ipaddrv6'] == $pconfig['type6'])) {
|
||||
if ($config[interfaces][$ifent]['prefix-6rd'] == $pconfig['prefix-6rd']) {
|
||||
|
||||
@ -68,6 +68,9 @@ function list_interfaces() {
|
||||
if (match_wireless_interface($key)) {
|
||||
continue;
|
||||
}
|
||||
if (preg_match('/_stf$/', $key)) {
|
||||
continue;
|
||||
}
|
||||
$interfaces[$key] = array('descr' => $key . ' (' . $intf_item['mac'] . ')', 'section' => 'interfaces');
|
||||
}
|
||||
// collect interfaces from defined config sections
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user