Commit 4a6ecd35 authored by Bob Copeland's avatar Bob Copeland Committed by Johannes Berg

mac80211: mesh: advertise gates in mesh formation

The Connected to Mesh Gate subfield (802.11-2016 9.4.2.98.7) in the Mesh
Formation Info field is currently unset.  This field may be useful in
determining which MBSSes to join or which mesh STAs to peer with.

If this mesh STA is a gate, by having turned on mesh gate announcements,
or if we have a path to one (e.g. by having received RANNs) then set this
bit to 1.
Signed-off-by: default avatarBob Copeland <bobcopeland@fb.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent e9da68dd
...@@ -254,6 +254,8 @@ int mesh_add_meshconf_ie(struct ieee80211_sub_if_data *sdata, ...@@ -254,6 +254,8 @@ int mesh_add_meshconf_ie(struct ieee80211_sub_if_data *sdata,
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
u8 *pos, neighbors; u8 *pos, neighbors;
u8 meshconf_len = sizeof(struct ieee80211_meshconf_ie); u8 meshconf_len = sizeof(struct ieee80211_meshconf_ie);
bool is_connected_to_gate = ifmsh->num_gates > 0 ||
ifmsh->mshcfg.dot11MeshGateAnnouncementProtocol;
if (skb_tailroom(skb) < 2 + meshconf_len) if (skb_tailroom(skb) < 2 + meshconf_len)
return -ENOMEM; return -ENOMEM;
...@@ -278,7 +280,7 @@ int mesh_add_meshconf_ie(struct ieee80211_sub_if_data *sdata, ...@@ -278,7 +280,7 @@ int mesh_add_meshconf_ie(struct ieee80211_sub_if_data *sdata,
/* Mesh Formation Info - number of neighbors */ /* Mesh Formation Info - number of neighbors */
neighbors = atomic_read(&ifmsh->estab_plinks); neighbors = atomic_read(&ifmsh->estab_plinks);
neighbors = min_t(int, neighbors, IEEE80211_MAX_MESH_PEERINGS); neighbors = min_t(int, neighbors, IEEE80211_MAX_MESH_PEERINGS);
*pos++ = neighbors << 1; *pos++ = (neighbors << 1) | is_connected_to_gate;
/* Mesh capability */ /* Mesh capability */
*pos = 0x00; *pos = 0x00;
*pos |= ifmsh->mshcfg.dot11MeshForwarding ? *pos |= ifmsh->mshcfg.dot11MeshForwarding ?
......
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