Feature #2151
closedAdd IPv6 support to the pfSense module
90%
Description
Lifted from /etc/inc/interfaces.inc FIXME notes.
We need something to set the IPv6 address. And we need to have a function return the IPv6 Address as well as the IPv6 link local address.
pfSense_interface_setaddress($realif, "{$wancfg['ipaddrv6']}/{$wancfg['subnetv6']}");
// FIXME: Add IPv6 Support to the pfSense module
mwexec("/sbin/ifconfig {$realif} inet6 {$wancfg['ipaddrv6']} prefixlen {$wancfg['subnetv6']} "); $ifinfo = pfSense_get_interface_addresses($interface);
// FIXME: Add IPv6 support to the pfSense module
exec("/sbin/ifconfig {$interface} inet6", $output);
foreach($output as $line) {
if(preg_match("/inet6/", $line)) {
$parts = explode(" ", $line);
if(! preg_match("/fe80::/", $parts[1])) {
$ifinfo['ipaddrv6'] = $parts[1];
if($parts[2] == "-->") {
$parts[5] = "126";
$ifinfo['subnetbitsv6'] = $parts[5];
} else {
$ifinfo['subnetbitsv6'] = $parts[3];
}
}
}
}
$interface_ipv6_arr_cache[$interface] = $ifinfo['ipaddrv6'];
$interface_snv6_arr_cache[$interface] = $ifinfo['subnetbitsv6'];
if (!isset($interface_llv6_arr_cache[$interface]) or $flush) {
$ifinfo = pfSense_get_interface_addresses($interface);
// FIXME: Add IPv6 support to the pfSense module
exec("/sbin/ifconfig {$interface} inet6", $output);
foreach($output as $line) {
if(preg_match("/inet6/", $line)) {
$parts = explode(" ", $line);
if(preg_match("/fe80::/", $parts[1])) {
$partsaddress = explode("%", $parts[1]);
$ifinfo['linklocal'] = $partsaddress[0];
}
}
}
$interface_llv6_arr_cache[$interface] = $ifinfo['linklocal'];
}
return $interface_llv6_arr_cache[$interface];
if (!isset($interface_snv6_arr_cache[$interface]) or $flush) {
$ifinfo = pfSense_get_interface_addresses($interface);
// FIXME: Add IPv6 support to the pfSense module
exec("/sbin/ifconfig {$interface} inet6", $output);
foreach($output as $line) {
if(preg_match("/inet6/", $line)) {
$parts = explode(" ", $line);
if(! preg_match("/fe80::/", $parts[1])) {
$ifinfo['ipaddrv6'] = $parts[1];
if($parts[2] == "-->") {
$parts[5] = "126";
$ifinfo['subnetbitsv6'] = $parts[5];
} else {
$ifinfo['subnetbitsv6'] = $parts[3];
}
}
}
}
$interface_ipv6_arr_cache[$interface] = $ifinfo['ipaddrv6'];
$interface_snv6_arr_cache[$interface] = $ifinfo['subnetbitsv6'];