Commit 6c6fa496 authored by Bob Copeland's avatar Bob Copeland Committed by Johannes Berg

mac80211: mesh_plink: handle confirm frames with new plid

The 802.11 standard says when processing a plink confirm
frame:

"If the peerLinkID in the mesh peering instance has not been
set, the Local Link ID field of the Mesh Peering Confirm
request shall be copied into the peerLinkID in the mesh
peering instance."

We were only doing this when receiving an open peering frame,
but it could happen that the open frame gets lost and so we
should handle this case rather than rejecting the confirm and
failing the whole peering process.
Reported-by: default avatarYu Niiro <yu.niiro@gmail.com>
Signed-off-by: default avatarBob Copeland <me@bobcopeland.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 3918edb0
...@@ -959,7 +959,8 @@ mesh_plink_get_event(struct ieee80211_sub_if_data *sdata, ...@@ -959,7 +959,8 @@ mesh_plink_get_event(struct ieee80211_sub_if_data *sdata,
if (!matches_local) if (!matches_local)
event = CNF_RJCT; event = CNF_RJCT;
if (!mesh_plink_free_count(sdata) || if (!mesh_plink_free_count(sdata) ||
(sta->llid != llid || sta->plid != plid)) sta->llid != llid ||
(sta->plid && sta->plid != plid))
event = CNF_IGNR; event = CNF_IGNR;
else else
event = CNF_ACPT; event = CNF_ACPT;
...@@ -1080,6 +1081,10 @@ mesh_process_plink_frame(struct ieee80211_sub_if_data *sdata, ...@@ -1080,6 +1081,10 @@ mesh_process_plink_frame(struct ieee80211_sub_if_data *sdata,
goto unlock_rcu; goto unlock_rcu;
} }
/* 802.11-2012 13.3.7.2 - update plid on CNF if not set */
if (!sta->plid && event == CNF_ACPT)
sta->plid = plid;
changed |= mesh_plink_fsm(sdata, sta, event); changed |= mesh_plink_fsm(sdata, sta, event);
unlock_rcu: unlock_rcu:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment