summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-03-26 23:34:33 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-03-26 23:34:33 +0000
commit23b4bf65071a7350aef24e54e6361f18170a8444 (patch)
treee51e2c4b077519f286acd9a541e5224c1b6eef8c
parent07b17c6b255ae579e4d287a8263d43fd794b5044 (diff)
downloadmtk-20170518-23b4bf65071a7350aef24e54e6361f18170a8444.zip
mtk-20170518-23b4bf65071a7350aef24e54e6361f18170a8444.tar.gz
mtk-20170518-23b4bf65071a7350aef24e54e6361f18170a8444.tar.bz2
hostapd: add 802.11r support
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be> SVN-Revision: 45051
-rw-r--r--package/network/services/hostapd/files/hostapd.sh29
-rw-r--r--package/network/services/hostapd/files/netifd.sh37
2 files changed, 65 insertions, 1 deletions
diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index a4b38d7..7aec7ad 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -219,6 +219,35 @@ hostapd_set_bss_options() {
then
config_get nasid "$vif" nasid
[ -n "$nasid" ] && append "$var" "nas_identifier=$nasid" "$N"
+
+ config_get_bool ieee80211r "$vif" ieee80211r 0
+ if [ "$ieee80211r" -gt 0 ]
+ then
+ config_get mobility_domain "$vif" mobility_domain "4f57"
+ config_get r0_key_lifetime "$vif" r0_key_lifetime "10000"
+ config_get r1_key_holder "$vif" r1_key_holder "00004f577274"
+ config_get reassociation_deadline "$vif" reassociation_deadline "1000"
+ config_get r0kh "$vif" r0kh
+ config_get r1kh "$vif" r1kh
+ config_get_bool pmk_r1_push "$vif" pmk_r1_push 0
+
+ append "$var" "mobility_domain=$mobility_domain" "$N"
+ append "$var" "r0_key_lifetime=$r0_key_lifetime" "$N"
+ append "$var" "r1_key_holder=$r1_key_holder" "$N"
+ append "$var" "reassociation_deadline=$reassociation_deadline" "$N"
+ append "$var" "pmk_r1_push=$pmk_r1_push" "$N"
+
+ for kh in $r0kh; do
+ "$var" "r0kh=${kh//,/ }" "$N"
+ done
+ for kh in $r1kh; do
+ "$var" "r1kh=${kh//,/ }" "$N"
+ done
+
+ [ "$wpa_key_mgmt" != "${wpa_key_mgmt/EAP/}" ] && append wpa_key_mgmt "FT-EAP"
+ [ "$wpa_key_mgmt" != "${wpa_key_mgmt/PSK/}" ] && append wpa_key_mgmt "FT-PSK"
+ fi
+
[ -n "wpa_key_mgmt" ] && append "$var" "wpa_key_mgmt=$wpa_key_mgmt"
fi
diff --git a/package/network/services/hostapd/files/netifd.sh b/package/network/services/hostapd/files/netifd.sh
index a5abdce..6e4b23b 100644
--- a/package/network/services/hostapd/files/netifd.sh
+++ b/package/network/services/hostapd/files/netifd.sh
@@ -148,6 +148,11 @@ hostapd_common_add_bss_config() {
config_add_boolean wps_pushbutton wps_label ext_registrar wps_pbc_in_m1
config_add_string wps_device_type wps_device_name wps_manufacturer wps_pin
+ config_add_boolean ieee80211r pmk_r1_push
+ config_add_int r0_key_lifetime reassociation_deadline
+ config_add_string mobility_domain r1_key_holder
+ config_add_array r0kh r1kh
+
config_add_int ieee80211w_max_timeout ieee80211w_retry_timeout
config_add_string macfilter 'macfile:file'
@@ -340,8 +345,38 @@ hostapd_set_bss_options() {
}
if [ "$wpa" -ge "1" ]; then
- json_get_vars nasid
+ json_get_vars nasid ieee80211r
[ -n "$nasid" ] && append bss_conf "nas_identifier=$nasid" "$N"
+
+ if [ "$ieee80211r" -gt "0" ]; then
+ json_get_vars mobility_domain r0_key_lifetime r1_key_holder \
+ reassociation_deadline pmk_r1_push
+ json_get_values r0kh r0kh
+ json_get_values r1kh r1kh
+
+ set_default mobility_domain "4f57"
+ set_default r0_key_lifetime 10000
+ set_default r1_key_holder "00004f577274"
+ set_default reassociation_deadline 1000
+ set_default pmk_r1_push 0
+
+ append bss_conf "mobility_domain=$mobility_domain" "$N"
+ append bss_conf "r0_key_lifetime=$r0_key_lifetime" "$N"
+ append bss_conf "r1_key_holder=$r1_key_holder" "$N"
+ append bss_conf "reassociation_deadline=$reassociation_deadline" "$N"
+ append bss_conf "pmk_r1_push=$pmk_r1_push" "$N"
+
+ for kh in $r0kh; do
+ append bss_conf "r0kh=${kh//,/ }" "$N"
+ done
+ for kh in $r1kh; do
+ append bss_conf "r1kh=${kh//,/ }" "$N"
+ done
+
+ [ "$wpa_key_mgmt" != "${wpa_key_mgmt/EAP/}" ] && append wpa_key_mgmt "FT-EAP"
+ [ "$wpa_key_mgmt" != "${wpa_key_mgmt/PSK/}" ] && append wpa_key_mgmt "FT-PSK"
+ fi
+
[ -n "$wpa_key_mgmt" ] && append bss_conf "wpa_key_mgmt=$wpa_key_mgmt" "$N"
fi