diff options
author | Sam Leffler <sam@FreeBSD.org> | 2006-04-28 19:06:15 +0000 |
---|---|---|
committer | Sam Leffler <sam@FreeBSD.org> | 2006-04-28 19:06:15 +0000 |
commit | ee25b8df01cc52d1725c8fd350fffc2edc2b3f36 (patch) | |
tree | 4d48996c7e645642bc5582e11cd9e6d3658477de /sys/net80211 | |
parent | 7eeda2279347b36be3d6b2ff0bbb40b550c0ef59 (diff) | |
download | src-ee25b8df01cc52d1725c8fd350fffc2edc2b3f36.tar.gz src-ee25b8df01cc52d1725c8fd350fffc2edc2b3f36.zip |
Ensure outbound data packets in hostap mode are delivered only to
stations that are associated by making ieee80211_find_txnode return
NULL when a unicast frame is to be delivered to an unassociated
station. This will be handled differently in the future but for
now putting the check here allows all drivers to immediately do
the right thing.
Reviewed by: avatar
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=158121
Diffstat (limited to 'sys/net80211')
-rw-r--r-- | sys/net80211/ieee80211_node.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 3108dd5d117a..444f2dc1996a 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -1454,8 +1454,19 @@ ieee80211_find_txnode(struct ieee80211com *ic, const u_int8_t *macaddr) IEEE80211_NODE_LOCK(nt); if (ic->ic_opmode == IEEE80211_M_STA || IEEE80211_IS_MULTICAST(macaddr)) ni = ieee80211_ref_node(ic->ic_bss); - else + else { ni = _ieee80211_find_node(nt, macaddr); + if (ic->ic_opmode == IEEE80211_M_HOSTAP && + (ni != NULL && ni->ni_associd == 0)) { + /* + * Station is not associated; don't permit the + * data frame to be sent by returning NULL. This + * is kinda a kludge but the least intrusive way + * to add this check into all drivers. + */ + ieee80211_unref_node(&ni); /* NB: null's ni */ + } + } IEEE80211_NODE_UNLOCK(nt); if (ni == NULL) { |