luci-mod-admin-full: Enable adhoc mode encryption options 1182/head
authorKishan Gondaliya <kishan.gondaliya@sibridgetech.com>
Mon, 5 Jun 2017 08:04:03 +0000 (13:34 +0530)
committerKishan Gondaliya <kishan.gondaliya@sibridgetech.com>
Mon, 5 Jun 2017 09:00:37 +0000 (14:30 +0530)
Currently there are only 2 encryption options visible for adhoc
mode. But in netifd, others are also supported and working as
expected. So adding WPA-PSK, WPA2-PSK and WPA-PSK/WPA2-PSK Mixed
mode as encryption options.

Signed-off-by: Kishan Gondaliya <kishanpgondaliya@gmail.com>
modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua

index 3a08d81..e1e21bc 100644 (file)
@@ -600,9 +600,9 @@ if hwtype == "mac80211" or hwtype == "prism2" then
        local has_sta_eap = (os.execute("wpa_supplicant -veap >/dev/null 2>/dev/null") == 0)
 
        if hostapd and supplicant then
-               encr:value("psk", "WPA-PSK", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"})
-               encr:value("psk2", "WPA2-PSK", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"})
-               encr:value("psk-mixed", "WPA-PSK/WPA2-PSK Mixed Mode", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"})
+               encr:value("psk", "WPA-PSK", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"}, {mode="adhoc"})
+               encr:value("psk2", "WPA2-PSK", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"}, {mode="adhoc"})
+               encr:value("psk-mixed", "WPA-PSK/WPA2-PSK Mixed Mode", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"}, {mode="adhoc"})
                if has_ap_eap and has_sta_eap then
                        encr:value("wpa", "WPA-EAP", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"})
                        encr:value("wpa2", "WPA2-EAP", {mode="ap"}, {mode="sta"}, {mode="ap-wds"}, {mode="sta-wds"})
@@ -620,9 +620,9 @@ if hwtype == "mac80211" or hwtype == "prism2" then
                        "and ad-hoc mode) to be installed."
                )
        elseif not hostapd and supplicant then
-               encr:value("psk", "WPA-PSK", {mode="sta"}, {mode="sta-wds"})
-               encr:value("psk2", "WPA2-PSK", {mode="sta"}, {mode="sta-wds"})
-               encr:value("psk-mixed", "WPA-PSK/WPA2-PSK Mixed Mode", {mode="sta"}, {mode="sta-wds"})
+               encr:value("psk", "WPA-PSK", {mode="sta"}, {mode="sta-wds"}, {mode="adhoc"})
+               encr:value("psk2", "WPA2-PSK", {mode="sta"}, {mode="sta-wds"}, {mode="adhoc"})
+               encr:value("psk-mixed", "WPA-PSK/WPA2-PSK Mixed Mode", {mode="sta"}, {mode="sta-wds"}, {mode="adhoc"})
                if has_sta_eap then
                        encr:value("wpa", "WPA-EAP", {mode="sta"}, {mode="sta-wds"})
                        encr:value("wpa2", "WPA2-EAP", {mode="sta"}, {mode="sta-wds"})