From d7956add9cf3069e6ed0c36bd61dba6601ce153e Mon Sep 17 00:00:00 2001 From: Shan Palanisamy Date: Mon, 25 Oct 2010 13:35:51 +0300 Subject: [PATCH] FT: Make FT-over-DS configurable (hostapd.conf ft_over_ds=0/1) --- hostapd/config_file.c | 2 ++ src/ap/ap_config.c | 4 ++++ src/ap/ap_config.h | 1 + src/ap/wpa_auth.h | 1 + src/ap/wpa_auth_ft.c | 4 +++- src/ap/wpa_auth_glue.c | 1 + 6 files changed, 12 insertions(+), 1 deletion(-) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index 4b9d09783..e89205972 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -1673,6 +1673,8 @@ struct hostapd_config * hostapd_config_read(const char *fname) } } else if (os_strcmp(buf, "pmk_r1_push") == 0) { bss->pmk_r1_push = atoi(pos); + } else if (os_strcmp(buf, "ft_over_ds") == 0) { + bss->ft_over_ds = atoi(pos); #endif /* CONFIG_IEEE80211R */ #ifndef CONFIG_NO_CTRL_IFACE } else if (os_strcmp(buf, "ctrl_interface") == 0) { diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c index a40362431..3fd82763f 100644 --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c @@ -89,6 +89,10 @@ void hostapd_config_defaults_bss(struct hostapd_bss_config *bss) /* Set to -1 as defaults depends on HT in setup */ bss->wmm_enabled = -1; + +#ifdef CONFIG_IEEE80211R + bss->ft_over_ds = 1; +#endif /* CONFIG_IEEE80211R */ } diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h index cdc676af2..0016a7c9b 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -232,6 +232,7 @@ struct hostapd_bss_config { struct ft_remote_r0kh *r0kh_list; struct ft_remote_r1kh *r1kh_list; int pmk_r1_push; + int ft_over_ds; #endif /* CONFIG_IEEE80211R */ char *ctrl_interface; /* directory for UNIX domain sockets */ diff --git a/src/ap/wpa_auth.h b/src/ap/wpa_auth.h index d0136c71b..52ef2573c 100644 --- a/src/ap/wpa_auth.h +++ b/src/ap/wpa_auth.h @@ -160,6 +160,7 @@ struct wpa_auth_config { struct ft_remote_r0kh *r0kh_list; struct ft_remote_r1kh *r1kh_list; int pmk_r1_push; + int ft_over_ds; #endif /* CONFIG_IEEE80211R */ }; diff --git a/src/ap/wpa_auth_ft.c b/src/ap/wpa_auth_ft.c index 6631d23ce..65f5f4caa 100644 --- a/src/ap/wpa_auth_ft.c +++ b/src/ap/wpa_auth_ft.c @@ -92,7 +92,9 @@ int wpa_write_mdie(struct wpa_auth_config *conf, u8 *buf, size_t len) *pos++ = MOBILITY_DOMAIN_ID_LEN + 1; os_memcpy(pos, conf->mobility_domain, MOBILITY_DOMAIN_ID_LEN); pos += MOBILITY_DOMAIN_ID_LEN; - capab = RSN_FT_CAPAB_FT_OVER_DS; + capab = 0; + if (conf->ft_over_ds) + capab |= RSN_FT_CAPAB_FT_OVER_DS; *pos++ = capab; return pos - buf; diff --git a/src/ap/wpa_auth_glue.c b/src/ap/wpa_auth_glue.c index bd97678a7..a6ce4c843 100644 --- a/src/ap/wpa_auth_glue.c +++ b/src/ap/wpa_auth_glue.c @@ -71,6 +71,7 @@ static void hostapd_wpa_auth_conf(struct hostapd_bss_config *conf, wconf->r0kh_list = conf->r0kh_list; wconf->r1kh_list = conf->r1kh_list; wconf->pmk_r1_push = conf->pmk_r1_push; + wconf->ft_over_ds = conf->ft_over_ds; #endif /* CONFIG_IEEE80211R */ }