summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorStephen Beaver <sbeaver@netgate.com>2016-06-21 14:29:08 -0400
committerStephen Beaver <sbeaver@netgate.com>2016-06-21 14:49:24 -0400
commit0891d12fd22a3a9e76cab9632a4fad94cbaf922a (patch)
tree4710ddd11d41b0f35764cbf133f36aa3ea1b5564 /src/usr
parent5051739d72d31f8bd250148dfa65213723275310 (diff)
downloadpfsense-0891d12fd22a3a9e76cab9632a4fad94cbaf922a.zip
pfsense-0891d12fd22a3a9e76cab9632a4fad94cbaf922a.tar.gz
Fixed #6498 by providing new address type argument to Form_IpAddress(). In this case it is specified as "V6".
(cherry picked from commit 3e4adb7139b4cddbb06a2aba7e0727d1762b35ee)
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/local/www/classes/Form/IpAddress.class.php18
-rw-r--r--src/usr/local/www/firewall_nat_npt_edit.php6
2 files changed, 19 insertions, 5 deletions
diff --git a/src/usr/local/www/classes/Form/IpAddress.class.php b/src/usr/local/www/classes/Form/IpAddress.class.php
index be2f4c1..72f885f 100644
--- a/src/usr/local/www/classes/Form/IpAddress.class.php
+++ b/src/usr/local/www/classes/Form/IpAddress.class.php
@@ -31,11 +31,23 @@ class Form_IpAddress extends Form_Input
{
protected $_mask;
- public function __construct($name, $title, $value)
+ public function __construct($name, $title, $value, $type = "BOTH")
{
parent::__construct($name, $title, 'text', $value);
- $this->_attributes['pattern'] = '[a-f0-9:.]*';
+ switch ($type) {
+ case "BOTH":
+ $this->_attributes['pattern'] = '[a-f0-9:.]*';
+ break;
+
+ case "V4":
+ $this->_attributes['pattern'] = '[a-f0-9.]*';
+ break;
+
+ case "V6":
+ $this->_attributes['pattern'] = '[a-f0-9:]*';
+ break;
+ }
}
// $min is provided to allow for VPN masks in which '0' is valid
@@ -58,7 +70,7 @@ class Form_IpAddress extends Form_Input
return parent::setIsRepeated();
}
-
+
protected function _getInput()
{
$input = parent::_getInput();
diff --git a/src/usr/local/www/firewall_nat_npt_edit.php b/src/usr/local/www/firewall_nat_npt_edit.php
index 907b55a..4ce89be 100644
--- a/src/usr/local/www/firewall_nat_npt_edit.php
+++ b/src/usr/local/www/firewall_nat_npt_edit.php
@@ -245,7 +245,8 @@ $section->addInput(new Form_Checkbox(
$section->addInput(new Form_IpAddress(
'src',
'Address',
- $pconfig['src']
+ $pconfig['src'],
+ 'V6'
))->addMask('srcmask', $pconfig['srcmask'])->setHelp('Internal (LAN) ULA IPv6 Prefix for the Network Prefix translation. ' .
'The prefix size specified for the internal IPv6 prefix will be applied to the external prefix.');
@@ -259,7 +260,8 @@ $section->addInput(new Form_Checkbox(
$section->addInput(new Form_IpAddress(
'dst',
'Address',
- $pconfig['dst']
+ $pconfig['dst'],
+ 'V6'
))->addMask('dstmask', $pconfig['dstmask'])->setHelp('Global Unicast routable IPv6 prefix');
$section->addInput(new Form_Input(
OpenPOWER on IntegriCloud