Signed-off-by: Thomas Pedersen <thomas@xxxxxxxxxxx> --- net/mac80211/mesh.c | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index a7078fd..19ec8bd 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c @@ -569,6 +569,7 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata, u32 supp_rates = 0; size_t baselen; int freq; + u8 *ies; enum ieee80211_band band = rx_status->band; /* ignore ProbeResp to foreign address */ @@ -576,12 +577,22 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata, compare_ether_addr(mgmt->da, sdata->vif.addr)) return; - baselen = (u8 *) mgmt->u.probe_resp.variable - (u8 *) mgmt; + switch (stype) { + case IEEE80211_STYPE_PROBE_RESP: + ies = (u8 *) mgmt->u.probe_resp.variable; + break; + case IEEE80211_STYPE_BEACON: + ies = (u8 *) mgmt->u.beacon.variable; + break; + default: + return; + } + + baselen = ies - (u8 *) mgmt; if (baselen > len) return; - ieee802_11_parse_elems(mgmt->u.probe_resp.variable, len - baselen, - &elems); + ieee802_11_parse_elems(ies, 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) -- 1.7.5.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html