summaryrefslogtreecommitdiffstats
path: root/etc/inc/IPv6.inc
diff options
context:
space:
mode:
authorDaniel Becker <razzfazz@gmail.com>2015-02-08 22:26:26 -0800
committerDaniel Becker <razzfazz@gmail.com>2015-02-09 01:49:28 -0800
commit09c7e42c07c3a0d72508e1a26d0e7550ccbfc21d (patch)
treef961ede3d1aafd554130c365d9b8ee73ad8323e4 /etc/inc/IPv6.inc
parent6d5d965875ea7e26b8e9113ce8281ccbb3da7a74 (diff)
downloadpfsense-09c7e42c07c3a0d72508e1a26d0e7550ccbfc21d.zip
pfsense-09c7e42c07c3a0d72508e1a26d0e7550ccbfc21d.tar.gz
fix Net_IPv6::compress() to properly handle all-zeros address
The existing implementation of Net_IPv6::compress produces an empty string when compressing the all-zeros ("::") address; fix this by checking for empty return values and replacing them with "::".
Diffstat (limited to 'etc/inc/IPv6.inc')
-rw-r--r--etc/inc/IPv6.inc6
1 files changed, 6 insertions, 0 deletions
diff --git a/etc/inc/IPv6.inc b/etc/inc/IPv6.inc
index e4f86bd..519cbcd 100644
--- a/etc/inc/IPv6.inc
+++ b/etc/inc/IPv6.inc
@@ -748,6 +748,12 @@ class Net_IPv6
$cip = preg_replace('/((^:)|(:$))/', '', $cip);
$cip = preg_replace('/((^:)|(:$))/', '::', $cip);
+ if (empty($cip)) {
+
+ $cip = "::";
+
+ }
+
if ('' != $netmask) {
$cip = $cip.'/'.$netmask;
OpenPOWER on IntegriCloud