aboutsummaryrefslogtreecommitdiffstats
path: root/src/ap/ieee802_11.c
diff options
context:
space:
mode:
authorBob Copeland <me@bobcopeland.com>2014-09-01 04:23:30 (GMT)
committerJouni Malinen <j@w1.fi>2014-11-16 17:43:11 (GMT)
commitc50d94f1f8c1e30ce6f0da01c2c4d2f591191617 (patch)
treed68c7ec68d40f6f97adf2e152c07f351028ac415 /src/ap/ieee802_11.c
parente96da42b0e1ba2380d101eaec00b27278d3e36e9 (diff)
downloadhostap-c50d94f1f8c1e30ce6f0da01c2c4d2f591191617.zip
hostap-c50d94f1f8c1e30ce6f0da01c2c4d2f591191617.tar.gz
hostap-c50d94f1f8c1e30ce6f0da01c2c4d2f591191617.tar.bz2
mesh: Start mesh peering after successful authentication
[original patch by: Thomas Pedersen <thomas@noack.us>] Signed-off-by: Bob Copeland <me@bobcopeland.com>
Diffstat (limited to 'src/ap/ieee802_11.c')
-rw-r--r--src/ap/ieee802_11.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index 8ced9af..4e389d0 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -802,10 +802,20 @@ static void handle_auth(struct hostapd_data *hapd,
return;
}
- sta = ap_sta_add(hapd, mgmt->sa);
- if (!sta) {
- resp = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA;
- goto fail;
+#ifdef CONFIG_MESH
+ if (hapd->conf->mesh & MESH_ENABLED) {
+ /* if the mesh peer is not available, we don't do auth. */
+ sta = ap_get_sta(hapd, mgmt->sa);
+ if (!sta)
+ return;
+ } else
+#endif /* CONFIG_MESH */
+ {
+ sta = ap_sta_add(hapd, mgmt->sa);
+ if (!sta) {
+ resp = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA;
+ goto fail;
+ }
}
if (vlan_id > 0) {
@@ -890,6 +900,20 @@ static void handle_auth(struct hostapd_data *hapd,
#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_SAE
case WLAN_AUTH_SAE:
+#ifdef CONFIG_MESH
+ if (hapd->conf->mesh & MESH_ENABLED) {
+ if (sta->wpa_sm == NULL)
+ sta->wpa_sm =
+ wpa_auth_sta_init(hapd->wpa_auth,
+ sta->addr, NULL);
+ if (sta->wpa_sm == NULL) {
+ wpa_printf(MSG_DEBUG,
+ "SAE: Failed to initialize WPA state machine");
+ resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
+ goto fail;
+ }
+ }
+#endif /* CONFIG_MESH */
handle_auth_sae(hapd, sta, mgmt, len, auth_transaction);
return;
#endif /* CONFIG_SAE */