diff options
author | gnhb <gnoahb@gmail.com> | 2011-01-25 11:36:28 +0700 |
---|---|---|
committer | gnhb <gnoahb@gmail.com> | 2011-01-25 11:36:28 +0700 |
commit | a3af81460c0b65d695f8b5d3626b4cac05f8c759 (patch) | |
tree | e66e6751d835be003241da605b55dfd2bed5cf3a /etc/inc | |
parent | 54ac5d9080c2ea6669af07aa49a5ce660f2ede76 (diff) | |
download | pfsense-a3af81460c0b65d695f8b5d3626b4cac05f8c759.zip pfsense-a3af81460c0b65d695f8b5d3626b4cac05f8c759.tar.gz |
Add NULL check to wireless functions.
The old interface_translate_type_to_real function used previously would return OPTX
if it was passed "OPTX" and OPTX existed but was unassigned, whereas get_real_interface returns NULL, so now we
check for NULL.
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/interfaces.inc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 2f2ddba..614d27b 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -2912,7 +2912,7 @@ function get_parent_interface($interface) { if (empty($config['interfaces'][$interface])) return $interface; - + $tmpif = $config['interfaces'][$interface]; switch ($tmpif['ipaddr']) { case "ppp": @@ -3482,7 +3482,7 @@ function get_wireless_modes($interface) { $wlif = get_real_interface($interface); - if(is_interface_wireless($wlif)) { + if($wlif != NULL && is_interface_wireless($wlif)) { $cloned_interface = get_real_interface($interface); $chan_list = "/sbin/ifconfig {$cloned_interface} list chan"; $stack_list = "/usr/bin/awk -F\"Channel \" '{ gsub(/\\*/, \" \"); print \$2 \"\\\n\" \$3 }'"; @@ -3528,7 +3528,7 @@ function get_wireless_channel_info($interface) { $wlif = get_real_interface($interface); - if(is_interface_wireless($wlif)) { + if($wlif != NULL && is_interface_wireless($wlif)) { $cloned_interface = get_real_interface($interface); $chan_list = "/sbin/ifconfig {$cloned_interface} list txpower"; $stack_list = "/usr/bin/awk -F\"Channel \" '{ gsub(/\\*/, \" \"); print \$2 \"\\\n\" \$3 }'"; |