hostapd: Use network_get_device instead of uci_get_state
authorFelix Fietkau <nbd@openwrt.org>
Wed, 11 Nov 2015 08:34:59 +0000 (08:34 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 11 Nov 2015 08:34:59 +0000 (08:34 +0000)
This fixes the IAPP functionality.

Signed-off-by: Petko Bordjukov <bordjukov@gmail.com>
SVN-Revision: 47455

package/network/services/hostapd/Makefile
package/network/services/hostapd/files/hostapd.sh
package/network/services/hostapd/files/netifd.sh

index edcfd1ba37a53ca381114657a3447117e4979e23..8a7fad6b65efb2639cfa388226ce26ba24cb7243 100644 (file)
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=hostapd
 PKG_VERSION:=2015-03-25
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_REV:=8278138e679174b1ec8af7f169c2810a8888e202
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
index 7aec7ad8a40ae843453e2c3e8f812a93c9635320..393233b8b46c689f522664bf7a2e1be42c77d040 100644 (file)
@@ -1,3 +1,5 @@
+. /lib/functions/network.sh
+
 hostapd_set_bss_options() {
        local var="$1"
        local vif="$2"
@@ -213,7 +215,11 @@ hostapd_set_bss_options() {
        append "$var" "ssid=$ssid" "$N"
        [ -n "$bridge" ] && append "$var" "bridge=$bridge" "$N"
        [ -n "$ieee80211d" ] && append "$var" "ieee80211d=$ieee80211d" "$N"
-       [ -n "$iapp_interface" ] && append "$var" iapp_interface=$(uci_get_state network "$iapp_interface" ifname "$iapp_interface") "$N"
+       [ -n "$iapp_interface" ] && {
+               local ifname
+               network_get_device ifname "$iapp_interface" || ifname = "$iapp_interface"
+               append bss_conf "iapp_interface=$ifname" "$N"
+       }
 
        if [ "$wpa" -ge "1" ]
        then
@@ -391,4 +397,3 @@ $hostapd_cfg
 EOF
        hostapd -P /var/run/wifi-$ifname.pid -B /var/run/hostapd-$ifname.conf
 }
-
index 9b40a234516f1f8625ba9a0e2367327bd697c26c..1c91bbf3c85f8764ecfe43e07b2d2933d7a7c130 100644 (file)
@@ -1,3 +1,5 @@
+. /lib/functions/network.sh
+
 wpa_supplicant_add_rate() {
        local var="$1"
        local val="$(($2 / 1000))"
@@ -351,8 +353,9 @@ hostapd_set_bss_options() {
        append bss_conf "ssid=$ssid" "$N"
        [ -n "$network_bridge" ] && append bss_conf "bridge=$network_bridge" "$N"
        [ -n "$iapp_interface" ] && {
-               iapp_interface="$(uci_get_state network "$iapp_interface" ifname "$iapp_interface")"
-               [ -n "$iapp_interface" ] && append bss_conf "iapp_interface=$iapp_interface" "$N"
+               local ifname
+               network_get_device ifname "$iapp_interface" || ifname = "$iapp_interface"
+               append bss_conf "iapp_interface=$ifname" "$N"
        }
 
        if [ "$wpa" -ge "1" ]; then