diff options
author | sam <sam@FreeBSD.org> | 2006-04-28 19:06:15 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2006-04-28 19:06:15 +0000 |
commit | 1ab3e7af300629ce191f9fbd6f2393ef3d0c7823 (patch) | |
tree | 4d48996c7e645642bc5582e11cd9e6d3658477de /sys | |
parent | 725e9bf143acb65436c146b30f08afebe2da9df8 (diff) | |
download | FreeBSD-src-1ab3e7af300629ce191f9fbd6f2393ef3d0c7823.zip FreeBSD-src-1ab3e7af300629ce191f9fbd6f2393ef3d0c7823.tar.gz |
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
Diffstat (limited to 'sys')
-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 3108dd5..444f2dc 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) { |