aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/mesh_mpm.c
diff options
context:
space:
mode:
authorBob Copeland <me@bobcopeland.com>2015-10-05 12:16:40 (GMT)
committerJouni Malinen <j@w1.fi>2015-10-05 22:27:29 (GMT)
commit681753f23cdcf636a6bfcde275e79c716a849c62 (patch)
tree99c13d8cb9ee56389de895aa8c1f53165be8538e /wpa_supplicant/mesh_mpm.c
parent41d621075e335fdde12a56f37f1d80cbf93b7770 (diff)
downloadhostap-681753f23cdcf636a6bfcde275e79c716a849c62.zip
hostap-681753f23cdcf636a6bfcde275e79c716a849c62.tar.gz
hostap-681753f23cdcf636a6bfcde275e79c716a849c62.tar.bz2
mesh: Generate proper AID for peer
IEEE Std 802.11-2012 13.3.1 states that the AID should be generated on the local node for each peer. Previously, we were using the peer link ID (generated by the peer) which may not be unique among all peers. Correct this by reusing the AP AID generation code. Signed-off-by: Bob Copeland <me@bobcopeland.com>
Diffstat (limited to 'wpa_supplicant/mesh_mpm.c')
-rw-r--r--wpa_supplicant/mesh_mpm.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/wpa_supplicant/mesh_mpm.c b/wpa_supplicant/mesh_mpm.c
index f81b88c..86b2bcb 100644
--- a/wpa_supplicant/mesh_mpm.c
+++ b/wpa_supplicant/mesh_mpm.c
@@ -258,7 +258,7 @@ static void mesh_mpm_send_plink_action(struct wpa_supplicant *wpa_s,
/* aid */
if (type == PLINK_CONFIRM)
- wpabuf_put_le16(buf, sta->peer_lid);
+ wpabuf_put_le16(buf, sta->aid);
/* IE: supp + ext. supp rates */
pos = hostapd_eid_supp_rates(bss, supp_rates);
@@ -561,13 +561,19 @@ static struct sta_info * mesh_mpm_add_peer(struct wpa_supplicant *wpa_s,
update_ht_state(data, sta);
#endif /* CONFIG_IEEE80211N */
+ if (hostapd_get_aid(data, sta) < 0) {
+ wpa_msg(wpa_s, MSG_ERROR, "No AIDs available");
+ ap_free_sta(data, sta);
+ return NULL;
+ }
+
/* insert into driver */
os_memset(&params, 0, sizeof(params));
params.supp_rates = sta->supported_rates;
params.supp_rates_len = sta->supported_rates_len;
params.addr = addr;
params.plink_state = sta->plink_state;
- params.aid = sta->peer_lid;
+ params.aid = sta->aid;
params.listen_interval = 100;
params.ht_capabilities = sta->ht_capabilities;
params.flags |= WPA_STA_WMM;