Revision 3000b44d
Added by Renato Botelho about 8 years ago
src/etc/inc/openvpn.inc | ||
---|---|---|
1957 | 1957 |
function openvpn_gen_route_ipv6($network, $iroute = false) { |
1958 | 1958 |
$i = ($iroute) ? "i" : ""; |
1959 | 1959 |
list($ipv6, $prefix) = explode('/', trim($network)); |
1960 |
if (empty($prefix) && !($prefix === "0")) {
|
|
1960 |
if (empty($prefix) && !is_numeric($prefix)) {
|
|
1961 | 1961 |
$prefix = "128"; |
1962 | 1962 |
} |
1963 | 1963 |
return "{$i}route-ipv6 ${ipv6}/${prefix}"; |
Also available in: Unified diff
Use is_numeric() to make sure $prefix is not 0