]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/mac80211/mesh.c
Merge tag 'iommu-updates-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / net / mac80211 / mesh.c
index 8bad414c52adc7d5b1c6f416da015dc9623ce9d3..c90452aa0c4241557e29473a4cfbc26be6ca3470 100644 (file)
@@ -254,6 +254,9 @@ int mesh_add_meshconf_ie(struct ieee80211_sub_if_data *sdata,
        struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
        u8 *pos, neighbors;
        u8 meshconf_len = sizeof(struct ieee80211_meshconf_ie);
+       bool is_connected_to_gate = ifmsh->num_gates > 0 ||
+               ifmsh->mshcfg.dot11MeshGateAnnouncementProtocol ||
+               ifmsh->mshcfg.dot11MeshConnectedToMeshGate;
 
        if (skb_tailroom(skb) < 2 + meshconf_len)
                return -ENOMEM;
@@ -278,7 +281,7 @@ int mesh_add_meshconf_ie(struct ieee80211_sub_if_data *sdata,
        /* Mesh Formation Info - number of neighbors */
        neighbors = atomic_read(&ifmsh->estab_plinks);
        neighbors = min_t(int, neighbors, IEEE80211_MAX_MESH_PEERINGS);
-       *pos++ = neighbors << 1;
+       *pos++ = (neighbors << 1) | is_connected_to_gate;
        /* Mesh capability */
        *pos = 0x00;
        *pos |= ifmsh->mshcfg.dot11MeshForwarding ?
@@ -1191,7 +1194,8 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
                if (!sdata->u.mesh.user_mpm ||
                    sdata->u.mesh.mshcfg.rssi_threshold == 0 ||
                    sdata->u.mesh.mshcfg.rssi_threshold < rx_status->signal)
-                       mesh_neighbour_update(sdata, mgmt->sa, &elems);
+                       mesh_neighbour_update(sdata, mgmt->sa, &elems,
+                                             rx_status);
        }
 
        if (ifmsh->sync_ops)