From c08360648acf6e64409df27212ef083e06a76b11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=C3=A7i?= Date: Sat, 18 Oct 2008 14:06:22 +0000 Subject: Cleanup some not needed code and use the correct debug var. A lot of code references $debug as var but actually there is only $g['debug'] and $debugging that are defined!! --- etc/inc/pfsense-utils.inc | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'etc') diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index b9e02db..bbd7737 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -2442,13 +2442,13 @@ function strncpy(&$dst, $src, $length) { * none ******/ function reload_interfaces_sync() { - global $config, $g, $debug; + global $config, $g; $shutdown_webgui_needed = false; touch("{$g['tmp_path']}/reloading_all"); - if($debug) + if($g['debug']) log_error("reload_interfaces_sync() is starting."); if(file_exists("{$g['tmp_path']}/config.cache")) @@ -2458,9 +2458,12 @@ function reload_interfaces_sync() { $config = parse_config(true); $wan_if = $config['interfaces']['wan']['if']; - $lan_if = $config['interfaces']['lan']['if']; + if (isset($config['interfaces']['lan'])) + $lan_if = $config['interfaces']['lan']['if']; + else + $lan_if = ""; - if($debug) + if($g['debug']) log_error("Cleaning up Interfaces"); /* if list */ @@ -2477,7 +2480,7 @@ function reload_interfaces_sync() { /* do not process lan interface, its mandatory */ if(stristr($ifname, "$lan_if") == true) continue; - if($debug) + if($g['debug']) log_error("Downing and deleting $ifname_real - $ifname"); mwexec("/sbin/ifconfig {$ifname_real} down"); mwexec("/sbin/ifconfig {$ifname_real} delete"); @@ -2487,17 +2490,17 @@ function reload_interfaces_sync() { interfaces_configure(); /* set up static routes */ - if($debug) + if($g['debug']) log_error("Configuring system Routing"); system_routing_configure(); /* enable routing */ - if($debug) + if($g['debug']) log_error("Enabling system routing"); system_routing_enable(); /* setup captive portal if needed */ - if($debug) + if($g['debug']) log_error("Configuring Captive portal"); captiveportal_configure(); @@ -2509,7 +2512,7 @@ function reload_interfaces_sync() { mwexec("/bin/rm /tmp/reload*"); /* remove reloading_all trigger */ - if($debug) + if($g['debug']) log_error("Removing {$g['tmp_path']}/reloading_all"); unlink_if_exists("{$g['tmp_path']}/reloading_all"); } @@ -2576,11 +2579,11 @@ function reload_all_sync() { /* Set up our loopback interface */ interfaces_loopback_configure(); - /* delete all old interface information */ - $iflist = split(" ", str_replace("\n", "", `/sbin/ifconfig -l`)); - $wan_if = $config['interfaces']['wan']['if']; - $lan_if = $config['interfaces']['lan']['if']; + if (isset($config['interfaces']['lan'])) + $lan_if = $config['interfaces']['lan']['if']; + else + $lan_if = ""; /* if list */ $iflist = get_configured_interface_list(); @@ -3965,4 +3968,4 @@ function read_body($ch, $string) { return $length; } -?> \ No newline at end of file +?> -- cgit v1.1