Merge pull request #634 from phil-davis/master

OpenVPN w/ IPv6 fails to set ifconfig-ipv6 value in conf #2991
This commit is contained in:
Chris Buechler 2013-05-13 21:00:56 -07:00
commit d68c18b526

View File

@ -1243,8 +1243,8 @@ function openvpn_get_interface_ipv6($ipv6, $prefix) {
// Is there a better way to do this math?
$ipv6_arr = explode(':', $basev6);
$last = hexdec(array_pop($ipv6_arr));
$ipv6_1 = Net_IPv6::compress(implode(':', $ipv6_arr) . ':' . dechex($last + 1));
$ipv6_2 = Net_IPv6::compress(implode(':', $ipv6_arr) . ':' . dechex($last + 2));
$ipv6_1 = Net_IPv6::compress(Net_IPv6::uncompress(implode(':', $ipv6_arr) . ':' . dechex($last + 1)));
$ipv6_2 = Net_IPv6::compress(Net_IPv6::uncompress(implode(':', $ipv6_arr) . ':' . dechex($last + 2)));
return array($ipv6_1, $ipv6_2);
}