summaryrefslogtreecommitdiffstats
path: root/src/usr/local
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2016-07-09 18:39:38 -0500
committerChris Buechler <cmb@pfsense.org>2016-07-09 18:40:39 -0500
commit48eb136f0a18e4f2ae006af4f8ea2f16334af583 (patch)
tree5533f18b2ec2db60109731231c64da833ffcba19 /src/usr/local
parentbfc9741a67394d794d77c2a0ce484d138515a246 (diff)
downloadpfsense-48eb136f0a18e4f2ae006af4f8ea2f16334af583.zip
pfsense-48eb136f0a18e4f2ae006af4f8ea2f16334af583.tar.gz
Add configuration for Min and MaxRtrAdvInterval. Ticket #6533
Diffstat (limited to 'src/usr/local')
-rw-r--r--src/usr/local/www/services_router_advertisements.php54
1 files changed, 49 insertions, 5 deletions
diff --git a/src/usr/local/www/services_router_advertisements.php b/src/usr/local/www/services_router_advertisements.php
index 017a1e2..3ec5d72 100644
--- a/src/usr/local/www/services_router_advertisements.php
+++ b/src/usr/local/www/services_router_advertisements.php
@@ -127,6 +127,8 @@ if (is_array($config['dhcpdv6'][$if])) {
$pconfig['ravalidlifetime'] = $config['dhcpdv6'][$if]['ravalidlifetime'];
$pconfig['rapreferredlifetime'] = $config['dhcpdv6'][$if]['rapreferredlifetime'];
+ $pconfig['raminrtradvinterval'] = $config['dhcpdv6'][$if]['raminrtradvinterval'];
+ $pconfig['ramaxrtradvinterval'] = $config['dhcpdv6'][$if]['ramaxrtradvinterval'];
$pconfig['radomainsearchlist'] = $config['dhcpdv6'][$if]['radomainsearchlist'];
list($pconfig['radns1'], $pconfig['radns2'], $pconfig['radns3']) = $config['dhcpdv6'][$if]['radnsserver'];
@@ -199,8 +201,30 @@ if ($_POST) {
}
}
- if ($_POST['ravalidlifetime'] && (!is_numeric($_POST['ravalidlifetime']) || ($_POST['ravalidlifetime'] < 7200))) {
- $input_errors[] = gettext("A valid lifetime below 2 hrs will be ignored by clients (RFC 4862 Section 5.5.3 point e)");
+ if ($_POST['ravalidlifetime'] && ($_POST['ravalidlifetime'] < 7200)) {
+ $input_errors[] = gettext("A valid lifetime below 2 hours will be ignored by clients (RFC 4862 Section 5.5.3 point e)");
+ }
+ if ($_POST['ravalidlifetime'] && !is_numericint($_POST['ravalidlifetime'])) {
+ $input_errors[] = gettext("Valid lifetime must be an integer.");
+ }
+ if ($_POST['raminrtradvinterval']) {
+ if (!is_numericint($_POST['raminrtradvinterval'])) {
+ $input_errors[] = gettext("Minimum advertisement interval must be an integer.");
+ }
+ if ($_POST['raminrtradvinterval'] < "3") {
+ $input_errors[] = gettext("Minimum advertisement interval must be no less than 3.");
+ }
+ if ($_POST['ramaxrtradvinterval'] && $_POST['raminrtradvinterval'] > (0.75 * $_POST['ramaxrtradvinterval'])) {
+ $input_errors[] = gettext("Minimum advertisement interval must be no greater than 0.75 * Maximum advertisement interval");
+ }
+ }
+ if ($_POST['ramaxrtradvinterval']) {
+ if (!is_numericint($_POST['ramaxrtradvinterval'])) {
+ $input_errors[] = gettext("Maximum advertisement interval must be an integer.");
+ }
+ if ($_POST['ramaxrtradvinterval'] < "4" || $_POST['ramaxrtradvinterval'] > "1800") {
+ $input_errors[] = gettext("Maximum advertisement interval must be no less than 4 and no greater than 1800.");
+ }
}
if (!$input_errors) {
@@ -214,6 +238,8 @@ if ($_POST) {
$config['dhcpdv6'][$if]['ravalidlifetime'] = $_POST['ravalidlifetime'];
$config['dhcpdv6'][$if]['rapreferredlifetime'] = $_POST['rapreferredlifetime'];
+ $config['dhcpdv6'][$if]['raminrtradvinterval'] = $_POST['raminrtradvinterval'];
+ $config['dhcpdv6'][$if]['ramaxrtradvinterval'] = $_POST['ramaxrtradvinterval'];
$config['dhcpdv6'][$if]['radomainsearchlist'] = $_POST['radomainsearchlist'];
unset($config['dhcpdv6'][$if]['radnsserver']);
@@ -345,9 +371,10 @@ if (count($carplistif) > 0) {
$section->addInput(new Form_Input(
'ravalidlifetime',
'Default valid lifetime',
- 'text',
- $pconfig['ravalidlifetime']
-))->setHelp('Seconds. The length of time in seconds (relative to the time the packet is sent) that the prefix is valid for the purpose of on-link determination.' . ' <br />' .
+ 'number',
+ $pconfig['ravalidlifetime'],
+ ['min' => 1, 'max' => 655350]
+))->setHelp('The length of time in seconds (relative to the time the packet is sent) that the prefix is valid for the purpose of on-link determination.' . ' <br />' .
'The default is 86400 seconds.');
$section->addInput(new Form_Input(
@@ -358,6 +385,23 @@ $section->addInput(new Form_Input(
))->setHelp('Seconds. The length of time in seconds (relative to the time the packet is sent) that addresses generated from the prefix via stateless address autoconfiguration remain preferred.' . ' <br />' .
'The default is 14400 seconds.');
+$section->addInput(new Form_Input(
+ 'raminrtradvinterval',
+ 'Minimum RA interval',
+ 'number',
+ $pconfig['raminrtradvinterval'],
+ ['min' => 3, 'max' => 1350]
+))->setHelp('Length in seconds');
+
+$section->addInput(new Form_Input(
+ 'ramaxrtradvinterval',
+ 'Maximum RA interval',
+ 'number',
+ $pconfig['ramaxrtradvinterval'],
+ ['min' => 4, 'max' => 1800]
+))->setHelp('The length of time in seconds');
+
+
$section->addInput(new Form_StaticText(
'RA Subnets',
$subnets_help
OpenPOWER on IntegriCloud