refactor is_specialnet(), interface administration contains all now

This commit is contained in:
Ad Schellevis 2016-06-01 11:56:56 +02:00
parent 3ef4f1dc3b
commit 153e7bc951

View File

@ -554,16 +554,16 @@ function pconfig_to_address(&$adr, $padr, $pmask, $pnot=false, $pbeginport=0, $p
function is_specialnet($net)
{
global $specialsrcdst;
if (!$net) {
return false;
}
if (is_array($specialsrcdst) && in_array($net, $specialsrcdst)) {
if (in_array($net, array('any','(self)'))) {
return true;
} else {
return false;
foreach (legacy_config_get_interfaces(array("enable" => true)) as $ifent => $ifdetail) {
if ($ifent == $net || (!isset($ifdetail['virtual']) && $ifent."ip" == $net)) {
return true;
}
}
}
return false;
}