From b4fe48f75e7530d81cb90e58bc003fb655c036aa Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 21 May 2013 11:56:27 +0000 Subject: hostapd: sync with trunk r36533 Signed-off-by: Felix Fietkau git-svn-id: svn://svn.openwrt.org/openwrt/branches/attitude_adjustment@36682 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/hostapd/files/hostapd-full.config | 2 +- package/hostapd/files/hostapd.sh | 25 +++++++++++++++++++++++++ package/hostapd/files/wpa_supplicant.sh | 7 +++++-- package/hostapd/files/wps-hotplug.sh | 2 ++ 4 files changed, 33 insertions(+), 3 deletions(-) (limited to 'package/hostapd/files') diff --git a/package/hostapd/files/hostapd-full.config b/package/hostapd/files/hostapd-full.config index 3a0ce12fc4..d558736db7 100644 --- a/package/hostapd/files/hostapd-full.config +++ b/package/hostapd/files/hostapd-full.config @@ -129,7 +129,7 @@ CONFIG_PKCS12=y CONFIG_IPV6=y # IEEE Std 802.11r-2008 (Fast BSS Transition) -#CONFIG_IEEE80211R=y +CONFIG_IEEE80211R=y # Use the hostapd's IEEE 802.11 authentication (ACL), but without # the IEEE 802.11 Management capability (e.g., madwifi or FreeBSD/net80211) diff --git a/package/hostapd/files/hostapd.sh b/package/hostapd/files/hostapd.sh index d60c26f3c6..00c6a094cf 100644 --- a/package/hostapd/files/hostapd.sh +++ b/package/hostapd/files/hostapd.sh @@ -12,6 +12,7 @@ hostapd_set_bss_options() { config_get_bool disassoc_low_ack "$vif" disassoc_low_ack 1 config_get max_num_sta "$vif" max_num_sta 0 config_get max_inactivity "$vif" max_inactivity 0 + config_get_bool preamble "$vif" short_preamble 1 config_get device "$vif" device config_get hwmode "$device" hwmode @@ -29,6 +30,9 @@ hostapd_set_bss_options() { append "$var" "ap_max_inactivity=$max_inactivity" "$N" fi append "$var" "disassoc_low_ack=$disassoc_low_ack" "$N" + if [ "$preamble" -gt 0 ]; then + append "$var" "preamble=$preamble" "$N" + fi # Examples: # psk-mixed/tkip => WPA1+2 PSK, TKIP @@ -210,6 +214,27 @@ hostapd_set_bss_options() { ;; esac fi + + config_get macfilter "$vif" macfilter + macfile="/var/run/hostapd-$ifname.maclist" + [ -e "$macfile" ] && rm -f "$macfile" + + case "$macfilter" in + allow) + append "$var" "macaddr_acl=1" "$N" + append "$var" "accept_mac_file=$macfile" "$N" + ;; + deny) + append "$var" "macaddr_acl=0" "$N" + append "$var" "deny_mac_file=$macfile" "$N" + ;; + esac + config_get maclist "$vif" maclist + [ -n "$maclist" ] && { + for mac in $maclist; do + echo "$mac" >> $macfile + done + } } hostapd_set_log_options() { diff --git a/package/hostapd/files/wpa_supplicant.sh b/package/hostapd/files/wpa_supplicant.sh index cdca9b5539..0b5e1d391f 100644 --- a/package/hostapd/files/wpa_supplicant.sh +++ b/package/hostapd/files/wpa_supplicant.sh @@ -106,7 +106,7 @@ wpa_supplicant_setup_vif() { config_get password "$vif" password phase2="phase2=\"auth=${auth:-MSCHAPV2}\"" identity="identity=\"$identity\"" - password="password=\"$password\"" + password="${password:+password=\"$password\"}" ;; esac eap_type="eap=$(echo $eap_type | tr 'a-z' 'A-Z')" @@ -186,6 +186,9 @@ network={ $wep_tx_keyidx } EOF - [ -z "$proto" -a "$key_mgmt" != "NONE" ] || \ + if [ -n "$proto" -o "$key_mgmt" == "NONE" ]; then wpa_supplicant ${bridge:+ -b $bridge} -B -P "/var/run/wifi-${ifname}.pid" -D ${driver:-wext} -i "$ifname" -c /var/run/wpa_supplicant-$ifname.conf $options + else + return 0 + fi } diff --git a/package/hostapd/files/wps-hotplug.sh b/package/hostapd/files/wps-hotplug.sh index b5376cc55b..ffd3cf929b 100644 --- a/package/hostapd/files/wps-hotplug.sh +++ b/package/hostapd/files/wps-hotplug.sh @@ -1,3 +1,5 @@ +#!/bin/sh + if [ "$ACTION" = "pressed" -a "$BUTTON" = "wps" ]; then for dir in /var/run/hostapd-*; do [ -d "$dir" ] || continue -- cgit v1.2.3