From 83f9c8ee5efd56d3fd905d4c84c1cce8ce33529b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=E7i?= Date: Tue, 23 Feb 2010 22:43:03 +0000 Subject: [PATCH] Ticket #304. Fix bogus dynamic entries in system->gateways after deleting gateways. --- etc/inc/gwlb.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 3cb47270f5..90949d4080 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -303,7 +303,7 @@ function return_gateways_array($disabled = false) { $gateway['attribute'] = "system"; /* Loopback dummy for dynamic interfaces without a IP */ - if(!is_ipaddr(trim($gateway['gateway']))) { + if(!is_ipaddr(trim($gateway['gateway'])) && $gateway['dynamic'] == true) { $gateway['gateway'] = "dynamic"; } @@ -520,7 +520,7 @@ function get_interface_gateway($interface, &$dynamic = false) { $gw = lookup_gateway_ip_by_name($gwcfg['gateway']); // for dynamic interfaces we handle them through the $interface_router file. - if (!is_ipaddr($gw)) { + if (!is_ipaddr($gw) && !is_ipaddr($gwcfg['ipaddr'])) { $realif = get_real_interface($interface); if (file_exists("{$g['tmp_path']}/{$realif}_router")) { $gw = file_get_contents("{$g['tmp_path']}/{$realif}_router");