From 87291c0269e77b029282676448fed3706a54211a Mon Sep 17 00:00:00 2001 From: Vladimir Koutny Date: Fri, 13 Jun 2008 16:50:44 +0200 Subject: mac80211: eliminate IBSS warning in rate_lowest_index() In IBSS mode prior to join/creation of new IBSS it is possible that a frame from unknown station is received and an ibss_add_sta() is called. This will cause a warning in rate_lowest_index() since the list of supported rates of our station is not initialized yet. The fix is to add ibss stations with a rate we received that frame at; this single-element set will be extended later based on beacon data. Also there is no need to store stations from a foreign IBSS. Signed-off-by: Vladimir Koutny Signed-off-by: John W. Linville --- net/mac80211/rx.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'net/mac80211/rx.c') diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index e80336f8f1e..c32a0bcd53b 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -1823,8 +1823,13 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata, if (!bssid) return 0; if ((rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT && - (rx->fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BEACON) + (rx->fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BEACON) { + if (!rx->sta) + rx->sta = ieee80211_ibss_add_sta(sdata->dev, + rx->skb, bssid, hdr->addr2, + BIT(rx->status->rate_idx)); return 1; + } else if (!ieee80211_bssid_match(bssid, sdata->u.sta.bssid)) { if (!(rx->flags & IEEE80211_RX_IN_SCAN)) return 0; @@ -1837,7 +1842,8 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata, rx->flags &= ~IEEE80211_RX_RA_MATCH; } else if (!rx->sta) rx->sta = ieee80211_ibss_add_sta(sdata->dev, rx->skb, - bssid, hdr->addr2); + bssid, hdr->addr2, + BIT(rx->status->rate_idx)); break; case IEEE80211_IF_TYPE_MESH_POINT: if (!multicast && -- cgit v1.2.3