From 36e4ebd1820a023fdc75b1f0749469f2e36c1f08 Mon Sep 17 00:00:00 2001 From: Joe Talbott Date: Fri, 11 Jun 2010 13:48:45 -0400 Subject: [PATCH] wlan - Bring in some fixes from FreeBSD. --- sys/netproto/802_11/wlan/ieee80211_hwmp.c | 4 ++++ sys/netproto/802_11/wlan/ieee80211_ioctl.c | 8 ++++++-- sys/netproto/802_11/wlan/ieee80211_scan_sta.c | 2 +- sys/netproto/802_11/wlan/ieee80211_sta.c | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/netproto/802_11/wlan/ieee80211_hwmp.c b/sys/netproto/802_11/wlan/ieee80211_hwmp.c index 6bfa02f629..f947fd6292 100644 --- a/sys/netproto/802_11/wlan/ieee80211_hwmp.c +++ b/sys/netproto/802_11/wlan/ieee80211_hwmp.c @@ -707,6 +707,10 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_node *ni, rtorig = ieee80211_mesh_rt_find(vap, preq->preq_origaddr); if (rtorig == NULL) rtorig = ieee80211_mesh_rt_add(vap, preq->preq_origaddr); + if (rtorig == NULL) { + /* XXX stat */ + return; + } hrorig = IEEE80211_MESH_ROUTE_PRIV(rtorig, struct ieee80211_hwmp_route); /* * Sequence number validation. diff --git a/sys/netproto/802_11/wlan/ieee80211_ioctl.c b/sys/netproto/802_11/wlan/ieee80211_ioctl.c index bdd6b09f6d..38d6054d2e 100644 --- a/sys/netproto/802_11/wlan/ieee80211_ioctl.c +++ b/sys/netproto/802_11/wlan/ieee80211_ioctl.c @@ -1593,8 +1593,10 @@ ieee80211_ioctl_setchanlist(struct ieee80211vap *vap, struct ieee80211req *ireq) if (list == NULL) return ENOMEM; error = copyin(ireq->i_data, list, ireq->i_len); - if (error) + if (error) { + free(list, M_TEMP); return error; + } nchan = 0; chanlist = list + ireq->i_len; /* NB: zero'd already */ maxchan = ireq->i_len * NBBY; @@ -1610,8 +1612,10 @@ ieee80211_ioctl_setchanlist(struct ieee80211vap *vap, struct ieee80211req *ireq) nchan++; } } - if (nchan == 0) + if (nchan == 0) { + free(list, M_TEMP); return EINVAL; + } if (ic->ic_bsschan != IEEE80211_CHAN_ANYC && /* XXX */ isclr(chanlist, ic->ic_bsschan->ic_ieee)) ic->ic_bsschan = IEEE80211_CHAN_ANYC; diff --git a/sys/netproto/802_11/wlan/ieee80211_scan_sta.c b/sys/netproto/802_11/wlan/ieee80211_scan_sta.c index 15d9ee6205..c8c4c28b55 100644 --- a/sys/netproto/802_11/wlan/ieee80211_scan_sta.c +++ b/sys/netproto/802_11/wlan/ieee80211_scan_sta.c @@ -1017,7 +1017,7 @@ match_bss(struct ieee80211vap *vap, */ if (se->se_capinfo & (IEEE80211_CAPINFO_IBSS|IEEE80211_CAPINFO_ESS)) fail |= MATCH_CAPINFO; - else if (se->se_meshid == NULL) + else if (&se->se_meshid == NULL) fail |= MATCH_MESH_NOID; else if (ms->ms_idlen != 0 && match_id(se->se_meshid, ms->ms_id, ms->ms_idlen)) diff --git a/sys/netproto/802_11/wlan/ieee80211_sta.c b/sys/netproto/802_11/wlan/ieee80211_sta.c index 137eae69b7..210718fb85 100644 --- a/sys/netproto/802_11/wlan/ieee80211_sta.c +++ b/sys/netproto/802_11/wlan/ieee80211_sta.c @@ -581,7 +581,7 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf) } IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); ni->ni_noise = nf; - if (HAS_SEQ(type)) { + if (HAS_SEQ(type) && !IEEE80211_IS_MULTICAST(wh->i_addr1)) { uint8_t tid = ieee80211_gettid(wh); if (IEEE80211_QOS_HAS_SEQ(wh) && TID_TO_WME_AC(tid) >= WME_AC_VI) -- 2.41.0