Deprecated config options 'wps_label' and 'wps_pbc'

The use of a list option 'wps_pushbutton' is more scalable.

Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelle...@gmail.com>

---

diff --git a/hostapd/files/hostapd.sh b/hostapd/files/hostapd.sh
--- a/hostapd/files/hostapd.sh
+++ b/hostapd/files/hostapd.sh
@@ -1,12 +1,14 @@
 hostapd_set_wps_options() {
-       local config_methods device_name device_type manufacturer\
-             wps_label wps_pbc
+       local config_methods device_name device_type manufacturer

+       config_get config_methods "$vif" wps_config_methods
+       
+       # deprecated options
+       local wps_label wps_pbc
        config_get_bool wps_pbc "$vif" wps_pushbutton 0
+       [ "$wps_pbc" -gt 0 ] && append config_methods push_button
        config_get_bool wps_label "$vif" wps_label 0
-
-       config_get config_methods "$vif" wps_config
-       [ "$wps_pbc" -gt 0 ] && append config_methods push_button
+       "$wps_label" -gt 0 ] && append config_methods label

        [ -z "$config_methods" ] && return

@@ -22,6 +24,18 @@
        append "$var" "device_name=$device_name" "$N"
        append "$var" "manufacturer=$manufacturer" "$N"
        append "$var" "config_methods=$config_methods" "$N"
+
+       # per-method options
+       list_contains config_methods label && {
+               list_remove config_methods label
+       }
+
+       list_contains config_methods push_button && {
+               list_remove config_methods push_button
+       }
+
+       [ -z "$config_methods" ] ||\
+               logger -t "$vif" "WPS config methods not supported: 
$config_methods"
 }

 hostapd_set_bss_options() {
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to