From ad70cdb2e4caa58b7f90fc56e7ed3cb36f663c0d Mon Sep 17 00:00:00 2001 From: Patrick Walther Date: Tue, 28 Jan 2020 15:14:35 +0100 Subject: [PATCH] ADD: add wpa_supplicant and hostapd to meta layer --- src/ap/hostapd.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index ebc0488d0..4cfa7d840 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -1384,10 +1384,9 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first) } if (conf->ieee802_11f && - (hapd->iapp = iapp_init(hapd, conf->iapp_iface)) == NULL) { - wpa_printf(MSG_ERROR, "IEEE 802.11F (IAPP) initialization " - "failed."); - return -1; + (hapd->iapp = iapp_init(hapd, hapd->conf->iapp_iface)) == NULL) { + hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, + HOSTAPD_LEVEL_DEBUG, "IEEE 802.11F (IAPP) initialization failed. Try again later"); } #ifdef CONFIG_INTERWORKING @@ -3249,8 +3248,19 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta, sta->post_csa_sa_query = 0; /* IEEE 802.11F (IAPP) */ - if (hapd->conf->ieee802_11f) + if (hapd->conf->ieee802_11f) { + if (!hapd->iapp) { + hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, + HOSTAPD_LEVEL_DEBUG, "IEEE 802.11F (IAPP) initialization try again"); + hapd->iapp = iapp_init(hapd, hapd->conf->iapp_iface); + } + if (hapd->iapp) { + hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, + HOSTAPD_LEVEL_DEBUG, "IEEE 802.11F (IAPP) initialization add new station"); iapp_new_station(hapd->iapp, sta); + } + } + #ifdef CONFIG_P2P if (sta->p2p_ie == NULL && !sta->no_p2p_set) {