summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2010-02-01 23:11:05 +0000
committerErmal Luçi <eri@pfsense.org>2010-02-01 23:11:05 +0000
commit1b773d206463ec1afaf81df36a7916441c0f6fea (patch)
treea00007abd2c922d2b7a39be6eaef7885d57373a2
parent6c0bf7feb032e57f101c018f2846fc0d48e336a0 (diff)
downloadpfsense-1b773d206463ec1afaf81df36a7916441c0f6fea.zip
pfsense-1b773d206463ec1afaf81df36a7916441c0f6fea.tar.gz
Ticket #329. Use correnct interface API and pass correct arguments to functions.
-rw-r--r--etc/inc/interfaces.inc12
-rwxr-xr-xusr/local/www/interfaces.php3
2 files changed, 7 insertions, 8 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 55b31a4..9b2a3b0 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -1358,7 +1358,7 @@ function interface_wireless_clone($realif, $wlcfg) {
if($needs_clone == true) {
/* remove previous instance if it exists */
if(does_interface_exist($realif))
- mwexec("/sbin/ifconfig {$wlcfg['if']}_wlan{$interface_num} destroy");
+ mwexec("/sbin/ifconfig {$realif} destroy");
log_error("Cloning new wireless interface {$realif}");
// Create the new wlan interface. FreeBSD returns the new interface name.
@@ -2808,13 +2808,13 @@ function get_wireless_modes($interface) {
/* return wireless modes and channels */
$wireless_modes = array();
- if(is_interface_wireless($interface)) {
+ $wlif = interface_translate_type_to_real($interface);
+
+ if(is_interface_wireless($wlif)) {
$cloned_interface = get_real_interface($interface);
$wi = 1;
- $ifconfig = "/sbin/ifconfig";
- $awk = "/usr/bin/awk";
- $chan_list = "$ifconfig $cloned_interface list chan";
- $stack_list = "$awk -F\"Channel \" '{ gsub(/\\*/, \" \"); print \$2 \"\\\n\" \$3 }'";
+ $chan_list = "/sbin/ifconfig {$cloned_interface} list chan";
+ $stack_list = "/usr/bin/awk -F\"Channel \" '{ gsub(/\\*/, \" \"); print \$2 \"\\\n\" \$3 }'";
$format_list = "$awk '{print \$5 \" \" \$6 \",\" \$1}'";
$interface_channels = "";
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php
index eed602f..2e0097b 100755
--- a/usr/local/www/interfaces.php
+++ b/usr/local/www/interfaces.php
@@ -213,9 +213,8 @@ $pconfig['mtu'] = $wancfg['mtu'];
/* Wireless interface? */
if (isset($wancfg['wireless'])) {
/* Get wireless modes */
- interface_wireless_clone($if, $wancfg);
- $curif = convert_friendly_interface_to_real_interface_name($if);
$wlanif = get_real_interface($if);
+ interface_wireless_clone($wlanif, $wancfg);
$wl_modes = get_wireless_modes($if);
$pconfig['standard'] = $wancfg['wireless']['standard'];
$pconfig['mode'] = $wancfg['wireless']['mode'];
OpenPOWER on IntegriCloud