mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
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 "::".
This commit is contained in:
parent
07efe7c0eb
commit
ce0e5d384d
@ -748,6 +748,12 @@ class Net_IPv6
|
||||
$cip = preg_replace('/((^:)|(:$))/', '', $cip);
|
||||
$cip = preg_replace('/((^:)|(:$))/', '::', $cip);
|
||||
|
||||
if (empty($cip)) {
|
||||
|
||||
$cip = "::";
|
||||
|
||||
}
|
||||
|
||||
if ('' != $netmask) {
|
||||
|
||||
$cip = $cip.'/'.$netmask;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user