Commit 8da32378 authored by Ad Schellevis's avatar Ad Schellevis

(legacy) remove cache stuff from find_interface_ipv6_ll

parent 154b9a29
......@@ -188,7 +188,7 @@ EOD;
if ($gateway['monitor'] == $gateway['gateway']) {
/* link locals really need a different src ip */
if (is_linklocal($gateway['gateway'])) {
$gwifip = find_interface_ipv6_ll($gateway['interface'], true);
$gwifip = find_interface_ipv6_ll($gateway['interface']);
} else {
$gwifip = find_interface_ipv6($gateway['interface']);
}
......
......@@ -4524,29 +4524,20 @@ function find_interface_ipv6($interface) {
/*
* find_interface_ipv6_ll($interface): return the interface ipv6 link local (first found)
*/
function find_interface_ipv6_ll($interface, $flush = false) {
global $interface_llv6_arr_cache;
global $config;
$interface = str_replace("\n", "", $interface);
if (!does_interface_exist($interface))
return;
/* Setup IP cache */
if (!isset($interface_llv6_arr_cache[$interface]) or $flush) {
$ifinfo = pfSense_getall_interface_addresses($interface);
foreach($ifinfo as $line) {
if (strstr($line, ":")) {
$parts = explode("/", $line);
if(is_linklocal($parts[0])) {
$ifinfo['linklocal'] = $parts[0];
function find_interface_ipv6_ll($interface) {
$interface = trim($interface);
if (does_interface_exist($interface)) {
$ifinfo = pfSense_getall_interface_addresses($interface);
foreach($ifinfo as $line) {
if (strstr($line, ":")) {
$parts = explode("/", $line);
if(is_linklocal($parts[0])) {
return $parts[0];
}
}
}
}
}
$interface_llv6_arr_cache[$interface] = $ifinfo['linklocal'];
}
return $interface_llv6_arr_cache[$interface];
return null;
}
function find_interface_subnet($interface, $flush = false) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment