summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-12-13 10:50:37 -0200
committerRenato Botelho <renato@netgate.com>2016-12-13 10:50:37 -0200
commit495aefc35cb927bed482e785ccf9cf86f86fe4bb (patch)
tree0204e67b3a5ea14aa31e461e21c2639dbe51de7a /src/usr
parent572dce1ff062abe5c965c5d0a6a70c2d9d4d0b54 (diff)
parent3cb06e5ffaa4d101267825715e777ace1fa30f41 (diff)
downloadpfsense-495aefc35cb927bed482e785ccf9cf86f86fe4bb.zip
pfsense-495aefc35cb927bed482e785ccf9cf86f86fe4bb.tar.gz
Merge pull request #3269 from phil-davis/patch-2
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/local/www/services_dhcpv6_relay.php23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/usr/local/www/services_dhcpv6_relay.php b/src/usr/local/www/services_dhcpv6_relay.php
index a80b529..b6f1964 100644
--- a/src/usr/local/www/services_dhcpv6_relay.php
+++ b/src/usr/local/www/services_dhcpv6_relay.php
@@ -39,6 +39,7 @@ if (empty($config['dhcrelay6']['interface'])) {
}
$pconfig['agentoption'] = isset($config['dhcrelay6']['agentoption']);
+$pconfig['server'] = $config['dhcrelay6']['server'];
$iflist = array_intersect_key(
get_configured_interface_with_descr(),
@@ -83,12 +84,11 @@ if ($_POST) {
if ($_POST['server']) {
foreach ($_POST['server'] as $checksrv => $srv) {
- if (!is_ipaddrv6($srv[0])) {
- $input_errors[] = gettext("A valid Destination Server IPv6 address must be specified.");
- }
-
-
if (!empty($srv[0])) { // Filter out any empties
+ if (!is_ipaddrv6($srv[0])) {
+ $input_errors[] = sprintf(gettext("Destination Server IP address %s is not a valid IPv6 address."), $srv[0]);
+ }
+
if (!empty($svrlist)) {
$svrlist .= ',';
}
@@ -96,9 +96,17 @@ if ($_POST) {
$svrlist .= $srv[0];
}
}
+
+ // Check that the user input something in one of the Destination Server fields
+ if (empty($svrlist)) {
+ $input_errors[] = gettext("At least one Destination Server IP address must be specified.");
+ }
}
}
+ // Now $svrlist is a comma separated list of servers ready to save to the config system
+ $pconfig['server'] = $svrlist;
+
if (!$input_errors) {
$config['dhcrelay6']['enable'] = $_POST['enable'] ? true : false;
$config['dhcrelay6']['interface'] = implode(",", $_POST['interface']);
@@ -113,8 +121,6 @@ if ($_POST) {
}
}
-$pconfig['server'] = $config['dhcrelay6']['server'];
-
$pgtitle = array(gettext("Services"), gettext("DHCPv6 Relay"));
$shortcut_section = "dhcp6";
include("head.inc");
@@ -169,7 +175,8 @@ function createDestinationServerInputGroup($value = null) {
$group->add(new Form_IpAddress(
'server',
'Destination server',
- $value
+ $value,
+ 'V6'
))->setWidth(4)
->setHelp('This is the IPv6 address of the server to which DHCPv6 requests are relayed.')
->setIsRepeated();
OpenPOWER on IntegriCloud