From a8a7325ea9cfb6ca4c940e99755efd013f0163ab Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 2 Oct 2005 17:30:55 +0000 Subject: [PATCH] Assign $wancfg array before resolving real interface --- etc/inc/interfaces.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index f5eebf275c..4b6b7e387e 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1211,10 +1211,10 @@ function get_real_wan_interface() { function get_current_wan_address($interface = "wan") { global $config, $g; - $interface = filter_translate_type_to_real_interface($interface); - $wancfg = $config['interfaces'][$interface]; + $interface = filter_translate_type_to_real_interface($interface); + if(in_array($wancfg['ipaddr'], array('dhcp'))) { /* get interface info with netstat */ exec("/usr/bin/netstat -nWI " . escapeshellarg($interface) . " -f inet", $ifinfo);