Make some more useful checks here

This commit is contained in:
Ermal 2014-11-10 16:15:08 +01:00
parent 6704590b35
commit d3c269d393
1 changed files with 2 additions and 2 deletions

View File

@ -966,7 +966,7 @@ function get_interface_gateway($interface, &$dynamic = false) {
}
// for dynamic interfaces we handle them through the $interface_router file.
if (!is_ipaddrv4($gw) && !is_ipaddrv4($gwcfg['ipaddr'])) {
if (($gw == NULL || !is_ipaddrv4($gw)) && !is_ipaddrv4($gwcfg['ipaddr'])) {
$realif = get_real_interface($interface);
if (file_exists("{$g['tmp_path']}/{$realif}_router")) {
$gw = trim(file_get_contents("{$g['tmp_path']}/{$realif}_router"), " \n");
@ -996,7 +996,7 @@ function get_interface_gateway_v6($interface, &$dynamic = false) {
}
// for dynamic interfaces we handle them through the $interface_router file.
if (!is_ipaddrv6($gw) && !is_ipaddrv6($gwcfg['ipaddrv6'])) {
if (($gw == NULL || !is_ipaddrv6($gw)) && !is_ipaddrv6($gwcfg['ipaddrv6'])) {
$realif = get_real_interface($interface);
if (file_exists("{$g['tmp_path']}/{$realif}_routerv6")) {
$gw = trim(file_get_contents("{$g['tmp_path']}/{$realif}_routerv6"), " \n");