From owner-p4-projects@FreeBSD.ORG Fri Nov 21 22:53:40 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 54BFE1065679; Fri, 21 Nov 2008 22:53:40 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 182281065670 for ; Fri, 21 Nov 2008 22:53:40 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 045F48FC08 for ; Fri, 21 Nov 2008 22:53:40 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mALMrd9H005649 for ; Fri, 21 Nov 2008 22:53:39 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mALMrdtv005647 for perforce@freebsd.org; Fri, 21 Nov 2008 22:53:39 GMT (envelope-from sam@freebsd.org) Date: Fri, 21 Nov 2008 22:53:39 GMT Message-Id: <200811212253.mALMrdtv005647@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 153310 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2008 22:53:40 -0000 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)",