Signed-off-by: Antonio Quartulli <[email protected]>
---
 package/mac80211/files/lib/wifi/mac80211.sh |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/package/mac80211/files/lib/wifi/mac80211.sh 
b/package/mac80211/files/lib/wifi/mac80211.sh
index 13390b8..3040ca4 100644
--- a/package/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/mac80211/files/lib/wifi/mac80211.sh
@@ -444,6 +444,17 @@ enable_mac80211() {
                                config_get mcast_rate "$vif" mcast_rate
 
                                local keyspec=""
+                               [ "$encryption" == "psk" -o "$encryption" == 
"psk2" ] && {
+                                       if eval "type wpa_supplicant_setup_vif" 
2>/dev/null >/dev/null; then
+                                               wpa_supplicant_setup_vif "$vif" 
nl80211 "${hostapd_ctrl:+-H $hostapd_ctrl}" $freq || {
+                                                       echo 
"enable_mac80211($device): Failed to set up wpa_supplicant for interface 
$ifname" >&2
+                                                       # make sure this wifi 
interface won't accidentally stay open without encryption
+                                                       ifconfig "$ifname" down
+                                                       continue
+                                               }
+                                       fi
+                               }
+
                                [ "$encryption" == "wep" ] && {
                                        case "$key" in
                                                [1234])
-- 
1.7.3.4

_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to