MCPcopy Create free account
hub / github.com/F-Stack/f-stack / hostap_auth_open

Function hostap_auth_open

freebsd/net80211/ieee80211_hostap.c:909–985  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

907}
908
909static void
910hostap_auth_open(struct ieee80211_node *ni, struct ieee80211_frame *wh,
911 int rssi, int nf, uint16_t seq, uint16_t status)
912{
913 struct ieee80211vap *vap = ni->ni_vap;
914
915 KASSERT(vap->iv_state == IEEE80211_S_RUN, ("state %d", vap->iv_state));
916
917 if (ni->ni_authmode == IEEE80211_AUTH_SHARED) {
918 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_AUTH,
919 ni->ni_macaddr, "open auth",
920 "bad sta auth mode %u", ni->ni_authmode);
921 vap->iv_stats.is_rx_bad_auth++; /* XXX */
922 /*
923 * Clear any challenge text that may be there if
924 * a previous shared key auth failed and then an
925 * open auth is attempted.
926 */
927 if (ni->ni_challenge != NULL) {
928 IEEE80211_FREE(ni->ni_challenge, M_80211_NODE);
929 ni->ni_challenge = NULL;
930 }
931 /* XXX hack to workaround calling convention */
932 ieee80211_send_error(ni, wh->i_addr2,
933 IEEE80211_FC0_SUBTYPE_AUTH,
934 (seq + 1) | (IEEE80211_STATUS_ALG<<16));
935 return;
936 }
937 if (seq != IEEE80211_AUTH_OPEN_REQUEST) {
938 vap->iv_stats.is_rx_bad_auth++;
939 return;
940 }
941 /* always accept open authentication requests */
942 if (ni == vap->iv_bss) {
943 ni = ieee80211_dup_bss(vap, wh->i_addr2);
944 if (ni == NULL)
945 return;
946 } else if ((ni->ni_flags & IEEE80211_NODE_AREF) == 0)
947 (void) ieee80211_ref_node(ni);
948 /*
949 * Mark the node as referenced to reflect that it's
950 * reference count has been bumped to insure it remains
951 * after the transaction completes.
952 */
953 ni->ni_flags |= IEEE80211_NODE_AREF;
954 /*
955 * Mark the node as requiring a valid association id
956 * before outbound traffic is permitted.
957 */
958 ni->ni_flags |= IEEE80211_NODE_ASSOCID;
959
960 if (vap->iv_acl != NULL &&
961 vap->iv_acl->iac_getpolicy(vap) == IEEE80211_MACCMD_POLICY_RADIUS) {
962 /*
963 * When the ACL policy is set to RADIUS we defer the
964 * authorization to a user agent. Dispatch an event,
965 * a subsequent MLME call will decide the fate of the
966 * station. If the user agent is not present then the

Callers 1

hostap_recv_mgmtFunction · 0.85

Calls 5

ieee80211_send_errorFunction · 0.85
ieee80211_dup_bssFunction · 0.85
ieee80211_ref_nodeFunction · 0.85
ieee80211_node_authorizeFunction · 0.85

Tested by

no test coverage detected