Date: Fri, 21 Nov 2008 22:53:39 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 153310 for review Message-ID: <200811212253.mALMrdtv005647@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=153310 Change 153310 by sam@sam_ebb on 2008/11/21 22:53:39 Unbreak ap mode and cleanup associd check on the tx path: o add a per-node IEEE80211_NODE_ASSOCID flag that means the association id must be non-zero for a packet to be sent to it o use the flag to do the associd check in ieee80211_start o mark sta vap bss node with the flag o mark ap vap nodes for sta's once they hit the auth state o remove the hack check in ieee80211_find_txnode for associated sta's to an ap having a valid associd; this is now checked in ieee80211_start so other paths are unbroken (e.g. raw packet xmit) NB: dwds vaps are handled because they share the node of the associated sta (or sta mode vap bss node) so automatically inherit the flag NB: previous change broke handling of mcast frames in ap mode Affected files ... .. //depot/projects/vap/sys/net80211/ieee80211_hostap.c#29 edit .. //depot/projects/vap/sys/net80211/ieee80211_node.c#52 edit .. //depot/projects/vap/sys/net80211/ieee80211_node.h#32 edit .. //depot/projects/vap/sys/net80211/ieee80211_output.c#64 edit Differences ... ==== //depot/projects/vap/sys/net80211/ieee80211_hostap.c#29 (text+ko) ==== @@ -928,6 +928,11 @@ * after the transaction completes. */ ni->ni_flags |= IEEE80211_NODE_AREF; + /* + * Mark the node as requiring a valid associatio id + * before outbound traffic is permitted. + */ + ni->ni_flags |= IEEE80211_NODE_ASSOCID; if (vap->iv_acl != NULL && vap->iv_acl->iac_getpolicy(vap) == IEEE80211_MACCMD_POLICY_RADIUS) { @@ -1054,6 +1059,11 @@ * after the transaction completes. */ ni->ni_flags |= IEEE80211_NODE_AREF; + /* + * Mark the node as requiring a valid associatio id + * before outbound traffic is permitted. + */ + ni->ni_flags |= IEEE80211_NODE_ASSOCID; IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); ni->ni_noise = noise; ni->ni_rstamp = rstamp; ==== //depot/projects/vap/sys/net80211/ieee80211_node.c#52 (text+ko) ==== @@ -732,6 +732,7 @@ ni->ni_erp = se->se_erp; IEEE80211_RSSI_LPF(ni->ni_avgrssi, se->se_rssi); ni->ni_noise = se->se_noise; + ni->ni_flags |= IEEE80211_NODE_ASSOCID; if (ieee80211_ies_init(&ni->ni_ies, se->se_ies.data, se->se_ies.len)) { ieee80211_ies_expand(&ni->ni_ies); @@ -1511,19 +1512,8 @@ vap->iv_opmode == IEEE80211_M_WDS || IEEE80211_IS_MULTICAST(macaddr)) ni = ieee80211_ref_node(vap->iv_bss); - else { + else ni = ieee80211_find_node_locked(nt, macaddr); - if (vap->iv_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) { ==== //depot/projects/vap/sys/net80211/ieee80211_node.h#32 (text+ko) ==== @@ -117,6 +117,7 @@ #define IEEE80211_NODE_RIFS 0x004000 /* RIFS enabled */ #define IEEE80211_NODE_SGI20 0x008000 /* Short GI in HT20 enabled */ #define IEEE80211_NODE_SGI40 0x010000 /* Short GI in HT40 enabled */ +#define IEEE80211_NODE_ASSOCID 0x020000 /* xmit requires associd */ uint16_t ni_associd; /* association ID */ uint16_t ni_vlan; /* vlan tag */ uint16_t ni_txpower; /* current transmit power */ ==== //depot/projects/vap/sys/net80211/ieee80211_output.c#64 (text+ko) ==== @@ -203,10 +203,8 @@ continue; } /* XXX AUTH'd */ - /* XXX mark vap to identify if associd is required */ if (ni->ni_associd == 0 && - (vap->iv_opmode == IEEE80211_M_STA || - vap->iv_opmode == IEEE80211_M_HOSTAP || IS_DWDS(vap))) { + (ni->ni_flags & IEEE80211_NODE_ASSOCID)) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_OUTPUT, eh->ether_dhost, NULL, "sta not associated (type 0x%04x)",
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811212253.mALMrdtv005647>