mac80211: Fix warnings due to -Wunused-but-set-variable
[firefly-linux-kernel-4.4.55.git] / net / mac80211 / mesh.c
index ca3af4685b0a6983e05aca4f87d76929ab8b4d23..c1299e24954166cde73832d39becf830fb01ef29 100644 (file)
@@ -279,9 +279,9 @@ void mesh_mgmt_ies_add(struct sk_buff *skb, struct ieee80211_sub_if_data *sdata)
            MESHCONF_CAPAB_ACCEPT_PLINKS : 0x00;
        *pos++ = 0x00;
 
-       if (sdata->u.mesh.vendor_ie) {
-               int len = sdata->u.mesh.vendor_ie_len;
-               const u8 *data = sdata->u.mesh.vendor_ie;
+       if (sdata->u.mesh.ie) {
+               int len = sdata->u.mesh.ie_len;
+               const u8 *data = sdata->u.mesh.ie;
                if (skb_tailroom(skb) > len)
                        memcpy(skb_put(skb, len), data, len);
        }
@@ -573,8 +573,12 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
        ieee802_11_parse_elems(mgmt->u.probe_resp.variable, len - baselen,
                               &elems);
 
+       /* ignore beacons from secure mesh peers if our security is off */
+       if (elems.rsn_len && !sdata->u.mesh.is_secure)
+               return;
+
        if (elems.ds_params && elems.ds_params_len == 1)
-               freq = ieee80211_channel_to_frequency(elems.ds_params[0]);
+               freq = ieee80211_channel_to_frequency(elems.ds_params[0], band);
        else
                freq = rx_status->freq;
 
@@ -586,9 +590,7 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
        if (elems.mesh_id && elems.mesh_config &&
            mesh_matches_local(&elems, sdata)) {
                supp_rates = ieee80211_sta_get_rates(local, &elems, band);
-
-               mesh_neighbour_update(mgmt->sa, supp_rates, sdata,
-                                     mesh_peer_accepts_plinks(&elems));
+               mesh_neighbour_update(mgmt->sa, supp_rates, sdata, &elems);
        }
 }
 
@@ -611,12 +613,9 @@ void ieee80211_mesh_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
                                   struct sk_buff *skb)
 {
        struct ieee80211_rx_status *rx_status;
-       struct ieee80211_if_mesh *ifmsh;
        struct ieee80211_mgmt *mgmt;
        u16 stype;
 
-       ifmsh = &sdata->u.mesh;
-
        rx_status = IEEE80211_SKB_RXCB(skb);
        mgmt = (struct ieee80211_mgmt *) skb->data;
        stype = le16_to_cpu(mgmt->frame_control) & IEEE80211_FCTL_STYPE;
@@ -645,7 +644,7 @@ void ieee80211_mesh_work(struct ieee80211_sub_if_data *sdata)
        if (test_and_clear_bit(MESH_WORK_GROW_MPATH_TABLE, &ifmsh->wrkq_flags))
                mesh_mpath_table_grow();
 
-       if (test_and_clear_bit(MESH_WORK_GROW_MPATH_TABLE, &ifmsh->wrkq_flags))
+       if (test_and_clear_bit(MESH_WORK_GROW_MPP_TABLE, &ifmsh->wrkq_flags))
                mesh_mpp_table_grow();
 
        if (test_and_clear_bit(MESH_WORK_HOUSEKEEPING, &ifmsh->wrkq_flags))