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; ...@@ -188,7 +188,7 @@ EOD;
if ($gateway['monitor'] == $gateway['gateway']) { if ($gateway['monitor'] == $gateway['gateway']) {
/* link locals really need a different src ip */ /* link locals really need a different src ip */
if (is_linklocal($gateway['gateway'])) { if (is_linklocal($gateway['gateway'])) {
$gwifip = find_interface_ipv6_ll($gateway['interface'], true); $gwifip = find_interface_ipv6_ll($gateway['interface']);
} else { } else {
$gwifip = find_interface_ipv6($gateway['interface']); $gwifip = find_interface_ipv6($gateway['interface']);
} }
......
...@@ -4524,29 +4524,20 @@ function find_interface_ipv6($interface) { ...@@ -4524,29 +4524,20 @@ function find_interface_ipv6($interface) {
/* /*
* find_interface_ipv6_ll($interface): return the interface ipv6 link local (first found) * find_interface_ipv6_ll($interface): return the interface ipv6 link local (first found)
*/ */
function find_interface_ipv6_ll($interface, $flush = false) { function find_interface_ipv6_ll($interface) {
global $interface_llv6_arr_cache; $interface = trim($interface);
global $config; if (does_interface_exist($interface)) {
$ifinfo = pfSense_getall_interface_addresses($interface);
$interface = str_replace("\n", "", $interface); foreach($ifinfo as $line) {
if (strstr($line, ":")) {
if (!does_interface_exist($interface)) $parts = explode("/", $line);
return; if(is_linklocal($parts[0])) {
return $parts[0];
/* 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];
} }
}
} }
$interface_llv6_arr_cache[$interface] = $ifinfo['linklocal']; return null;
}
return $interface_llv6_arr_cache[$interface];
} }
function find_interface_subnet($interface, $flush = false) { 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