diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index cfbfcc595..c2c61d066 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -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");