Commit 812fa8fc authored by Franco Fichtner's avatar Franco Fichtner

interfaces: old switcheroo for eventual php module removal

Only one function left.  :)

(cherry picked from commit 4e8debf8)
parent b7877986
......@@ -2904,22 +2904,20 @@ function interface_configure($interface = 'wan', $reloadall = false, $linkupeven
if (!file_exists("/var/run/booting") && !(substr($realif, 0, 4) == "ovpn")) {
/* remove all IPv4 and IPv6 addresses */
$tmpifaces = pfSense_getall_interface_addresses($realif);
if (is_array($tmpifaces)) {
foreach ($tmpifaces as $tmpiface) {
if (is_ipaddrv6($tmpiface) || is_subnetv6($tmpiface)) {
if (!is_linklocal($tmpiface)) {
mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " inet6 {$tmpiface} delete");
}
$tmpifaces = legacy_getall_interface_addresses($realif);
foreach ($tmpifaces as $tmpiface) {
if (is_ipaddrv6($tmpiface) || is_subnetv6($tmpiface)) {
if (!is_linklocal($tmpiface)) {
mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " inet6 {$tmpiface} delete");
}
} else {
if (is_subnetv4($tmpiface)) {
$tmpip = explode('/', $tmpiface);
$tmpip = $tmpip[0];
} else {
if (is_subnetv4($tmpiface)) {
$tmpip = explode('/', $tmpiface);
$tmpip = $tmpip[0];
} else {
$tmpip = $tmpiface;
}
legacy_interface_deladdress($realif, $tmpip);
$tmpip = $tmpiface;
}
legacy_interface_deladdress($realif, $tmpip);
}
}
......@@ -4664,7 +4662,7 @@ function find_interface_ipv6_ll($interface)
{
$interface = trim($interface);
if (does_interface_exist($interface)) {
$ifinfo = pfSense_getall_interface_addresses($interface);
$ifinfo = legacy_getall_interface_addresses($interface);
foreach ($ifinfo as $line) {
if (strstr($line, ":")) {
$parts = explode("/", $line);
......
......@@ -64,7 +64,7 @@ function does_vip_exist($vip) {
return false;
}
$ifacedata = pfSense_getall_interface_addresses($realif);
$ifacedata = legacy_getall_interface_addresses($realif);
foreach ($ifacedata as $vipips) {
if ($vipips == "{$vip['subnet']}/{$vip['subnet_bits']}") {
return true;
......
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