mac80211: Check size of a new mesh path table for changes since allocation.
[linux-2.6-microblaze.git] / net / mac80211 / mesh.c
index 2a57cc0..75378e8 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,6 +573,10 @@ 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.security == IEEE80211_MESH_SEC_NONE)
+               return;
+
        if (elems.ds_params && elems.ds_params_len == 1)
                freq = ieee80211_channel_to_frequency(elems.ds_params[0], band);
        else
@@ -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);
        }
 }
 
@@ -598,7 +600,7 @@ static void ieee80211_mesh_rx_mgmt_action(struct ieee80211_sub_if_data *sdata,
                                          struct ieee80211_rx_status *rx_status)
 {
        switch (mgmt->u.action.category) {
-       case WLAN_CATEGORY_MESH_PLINK:
+       case WLAN_CATEGORY_MESH_ACTION:
                mesh_rx_plink_frame(sdata, mgmt, len, rx_status);
                break;
        case WLAN_CATEGORY_MESH_PATH_SEL:
@@ -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;