diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2016-06-21 14:29:08 -0400 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2016-06-21 14:47:27 -0400 |
commit | 2c4af48f52765971a43368371953f24512c47d7e (patch) | |
tree | a23b5f1f5dde03f46a6326e4ca804b678fdfe7c3 /src | |
parent | 00a7688401c15015c3f43735b2b1536ebfec7e92 (diff) | |
download | pfsense-2c4af48f52765971a43368371953f24512c47d7e.zip pfsense-2c4af48f52765971a43368371953f24512c47d7e.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')
-rw-r--r-- | src/usr/local/www/classes/Form/IpAddress.class.php | 18 | ||||
-rw-r--r-- | src/usr/local/www/firewall_nat_npt_edit.php | 6 |
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( |