diff options
author | Espen Johansen <lsf@pfsense.org> | 2005-09-18 18:40:45 +0000 |
---|---|---|
committer | Espen Johansen <lsf@pfsense.org> | 2005-09-18 18:40:45 +0000 |
commit | ba0956f3977bb77051678ada311a21a648f59d8a (patch) | |
tree | 232d08c9f25bf770d37d8f1d24e757c237124983 | |
parent | 3b9a23f54410c6720e7510e87e5f92fe15e6af57 (diff) | |
download | pfsense-ba0956f3977bb77051678ada311a21a648f59d8a.zip pfsense-ba0956f3977bb77051678ada311a21a648f59d8a.tar.gz |
Adding (EXPERIMENTAL) WPA Support.
Adding ifconfig down / up in order to activate channel changes and other ifconfig changes.
-rw-r--r-- | etc/inc/interfaces.inc | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 8a7edbd..a86819e 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -387,7 +387,7 @@ function interfaces_wireless_configure($if, $wlcfg) { /* set values for /path/program */ $hostapd = "/usr/sbin/hostapd"; $wpa_supplicant = "/usr/sbin/wpa_supplicant"; - $killall = "/usr/bin/killall"; + $ifconfig = "/sbin/ifconfig "; /* set wireless channel value. if we're using 0 then * convert the channel to - @@ -397,8 +397,7 @@ function interfaces_wireless_configure($if, $wlcfg) { $channel = ""; /* wireless configuration */ - $ifcargs = escapeshellarg($if) . - " ssid " . escapeshellarg($wlcfg['ssid']) . " channel {$channel} "; + $ifcargs = escapeshellarg($if) . " ssid " . escapeshellarg($wlcfg['ssid']) . " channel {$channel}"; if ($wlcfg['stationname']) $ifcargs .= "stationname " . escapeshellarg($wlcfg['stationname']) . " "; @@ -536,32 +535,34 @@ EOD; $ifcargs .= "-hidessid "; /* handle pureg (802.11g) only option */ - if(isset($wlcfg['pureg'])) + if(isset($wlcfg['pureg']['enable'])) $ifcargs .= "pureg "; else $ifcargs .= "-pureg "; /* handle turbo option */ - if(isset($wlcfg['turbo'])) + if(isset($wlcfg['turbo']['enable'])) $ifcargs .= "mediaopt turbo "; else - $ifcargs .= "mediaopt -turbo "; + $ifcargs .= "-mediaopt turbo "; /* handle txpower setting */ if($wlcfg['txpower'] <> "") $ifcargs .= "txpower {$wlcfg['txpower']} "; /* handle wme option */ - if(isset($wlcfg['wme'])) - $ifcargs .= "wme "; + if(isset($wlcfg['wme']['enable'])) + $ifcargs .= " wme"; else - $ifcargs .= "-wme "; + $ifcargs .= " -wme"; } - $ifcargs .= "up"; + + mwexec($ifconfig . $if . " down"); + mwexec($ifconfig . $ifcargs); + mwexec($ifconfig . " up"); - mwexec("/sbin/ifconfig " . $ifcargs); $fd = fopen("{$g['tmp_path']}/ifconfig_wireless", "w"); fwrite($fd, "/sbin/ifconfig {$ifcargs}"); |