diff options
author | Ashok Nagarajan <ashok@cozybit.com> | 2012-04-02 21:21:22 -0700 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-04-11 16:23:47 -0400 |
commit | fe40cb6274988852aa5a84440d8f81c00cea4028 (patch) | |
tree | 06bc58c36c4c9f50e4f737b650a8004d9287bb6b /net/mac80211/mesh.c | |
parent | 9ebb61a23d90703344fc609fbee8da67b1e7456c (diff) | |
download | talos-op-linux-fe40cb6274988852aa5a84440d8f81c00cea4028.tar.gz talos-op-linux-fe40cb6274988852aa5a84440d8f81c00cea4028.zip |
mac80211: Check basic rates when peering
Section 13.2.3 of IEEE 80211s standard requires BSSBasicRateSet of mesh nodes
to be identical to establish peer link.
Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mesh.c')
-rw-r--r-- | net/mac80211/mesh.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index 7b22822d4208..133c118526fb 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c @@ -66,11 +66,13 @@ static void ieee80211_mesh_housekeeping_timer(unsigned long data) * * @ie: information elements of a management frame from the mesh peer * @sdata: local mesh subif + * @basic_rates: BSSBasicRateSet of the peer candidate * * This function checks if the mesh configuration of a mesh point matches the * local mesh configuration, i.e. if both nodes belong to the same mesh network. */ -bool mesh_matches_local(struct ieee802_11_elems *ie, struct ieee80211_sub_if_data *sdata) +bool mesh_matches_local(struct ieee802_11_elems *ie, + struct ieee80211_sub_if_data *sdata, u32 basic_rates) { struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; struct ieee80211_local *local = sdata->local; @@ -94,6 +96,9 @@ bool mesh_matches_local(struct ieee802_11_elems *ie, struct ieee80211_sub_if_dat (ifmsh->mesh_auth_id == ie->mesh_config->meshconf_auth))) goto mismatch; + if (sdata->vif.bss_conf.basic_rates != basic_rates) + goto mismatch; + /* disallow peering with mismatched channel types for now */ if (ie->ht_operation && (local->_oper_channel_type != @@ -656,12 +661,12 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata, if (!channel || channel->flags & IEEE80211_CHAN_DISABLED) return; + supp_rates = ieee80211_sta_get_rates(local, &elems, + band, &basic_rates); + if (elems.mesh_id && elems.mesh_config && - mesh_matches_local(&elems, sdata)) { - supp_rates = ieee80211_sta_get_rates(local, &elems, - band, &basic_rates); + mesh_matches_local(&elems, sdata, basic_rates)) mesh_neighbour_update(mgmt->sa, supp_rates, sdata, &elems); - } if (ifmsh->sync_ops) ifmsh->sync_ops->rx_bcn_presp(sdata, |