diff options
author | Renato Botelho <renato@netgate.com> | 2016-08-31 08:32:35 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-08-31 08:32:35 -0300 |
commit | beb7a6989fb75c1af1d6550402a9d1ee10ffe233 (patch) | |
tree | fc139d6402d70df52815531d4529014d2aee8619 | |
parent | 991797108b614d79874c88092a28e9fedd381ab9 (diff) | |
parent | 8fe8ceff998f32c752f5920e9099dc51c14b179f (diff) | |
download | pfsense-beb7a6989fb75c1af1d6550402a9d1ee10ffe233.zip pfsense-beb7a6989fb75c1af1d6550402a9d1ee10ffe233.tar.gz |
Merge pull request #3125 from NewEraCracker/patch-net_ipv6
-rw-r--r-- | src/etc/inc/IPv6.inc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/etc/inc/IPv6.inc b/src/etc/inc/IPv6.inc index d297ed1..5b7fb06 100644 --- a/src/etc/inc/IPv6.inc +++ b/src/etc/inc/IPv6.inc @@ -557,7 +557,7 @@ class Net_IPv6 if (false !== strpos($uip, '::') ) { - list($ip1, $ip2, $ip3) = explode('::', $uip); + list($ip1, $ip2) = explode('::', $uip, 2); if ("" == $ip1) { @@ -606,13 +606,6 @@ class Net_IPv6 $uip = "0:0:0:0:0:0:0:0"; - if (isset($ip3)) { // ::::xxx - not good - if ("" == $ip3) { // :::: - $ip3 = 0; // Give back a 9th "0" - } - $uip .= ":" . $ip3; - } - } else if (-1 == $c1) { // ::xxx $fill = str_repeat('0:', max(1, 7-$c2)); @@ -899,6 +892,10 @@ class Net_IPv6 if (!empty($ipPart[0])) { $ipv6 = explode(':', $ipPart[0]); + if(8 < count($ipv6)) { + return false; + } + foreach($ipv6 as $element) { // made a validate precheck if(!preg_match('/^[0-9a-fA-F]*$/', $element)) { return false; |