diff options
author | Daniel Becker <razzfazz@gmail.com> | 2015-02-08 22:26:26 -0800 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2015-02-23 16:05:40 -0300 |
commit | ce0e5d384d892beb80c39c47e7a91fc894e825a2 (patch) | |
tree | 80ecdecabf3b8f64b73eda242eb319332ee7c2d9 /etc/inc/IPv6.inc | |
parent | 07efe7c0ebe6a2b434efdbb41acd506db0e2bd48 (diff) | |
download | pfsense-ce0e5d384d892beb80c39c47e7a91fc894e825a2.zip pfsense-ce0e5d384d892beb80c39c47e7a91fc894e825a2.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.inc | 6 |
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; |