mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
simplify ieee80211_node_authorize and ieee80211_node_unauthorize api's
MFC after: 3 days
This commit is contained in:
parent
f62121ce8e
commit
e4918ecdb9
8 changed files with 15 additions and 15 deletions
|
|
@ -842,7 +842,7 @@ ipw_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
|
|||
|
||||
ieee80211_ref_node(ni);
|
||||
ieee80211_sta_join(ic, ni);
|
||||
ieee80211_node_authorize(ic, ni);
|
||||
ieee80211_node_authorize(ni);
|
||||
|
||||
if (ic->ic_opmode == IEEE80211_M_STA)
|
||||
ieee80211_notify_node_join(ic, ni, 1);
|
||||
|
|
|
|||
|
|
@ -1124,7 +1124,7 @@ iwi_notification_intr(struct iwi_softc *sc, struct iwi_notif *notif)
|
|||
|
||||
switch (auth->state) {
|
||||
case IWI_AUTHENTICATED:
|
||||
ieee80211_node_authorize(ic, ic->ic_bss);
|
||||
ieee80211_node_authorize(ic->ic_bss);
|
||||
ieee80211_new_state(ic, IEEE80211_S_ASSOC, -1);
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -904,7 +904,7 @@ ieee80211_auth_open(struct ieee80211com *ic, struct ieee80211_frame *wh,
|
|||
* authorized at this point so traffic can flow.
|
||||
*/
|
||||
if (ni->ni_authmode != IEEE80211_AUTH_8021X)
|
||||
ieee80211_node_authorize(ic, ni);
|
||||
ieee80211_node_authorize(ni);
|
||||
break;
|
||||
|
||||
case IEEE80211_M_STA:
|
||||
|
|
@ -1127,7 +1127,7 @@ ieee80211_auth_shared(struct ieee80211com *ic, struct ieee80211_frame *wh,
|
|||
IEEE80211_MSG_DEBUG | IEEE80211_MSG_AUTH,
|
||||
"[%s] station authenticated (shared key)\n",
|
||||
ether_sprintf(ni->ni_macaddr));
|
||||
ieee80211_node_authorize(ic, ni);
|
||||
ieee80211_node_authorize(ni);
|
||||
break;
|
||||
default:
|
||||
IEEE80211_DISCARD_MAC(ic, IEEE80211_MSG_AUTH,
|
||||
|
|
|
|||
|
|
@ -1685,9 +1685,9 @@ ieee80211_ioctl_setmlme(struct ieee80211com *ic, struct ieee80211req *ireq)
|
|||
if (ni == NULL)
|
||||
return EINVAL;
|
||||
if (mlme.im_op == IEEE80211_MLME_AUTHORIZE)
|
||||
ieee80211_node_authorize(ic, ni);
|
||||
ieee80211_node_authorize(ni);
|
||||
else
|
||||
ieee80211_node_unauthorize(ic, ni);
|
||||
ieee80211_node_unauthorize(ni);
|
||||
ieee80211_free_node(ni);
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -200,14 +200,16 @@ ieee80211_node_detach(struct ieee80211com *ic)
|
|||
*/
|
||||
|
||||
void
|
||||
ieee80211_node_authorize(struct ieee80211com *ic, struct ieee80211_node *ni)
|
||||
ieee80211_node_authorize(struct ieee80211_node *ni)
|
||||
{
|
||||
struct ieee80211com *ic = ni->ni_ic;
|
||||
|
||||
ni->ni_flags |= IEEE80211_NODE_AUTH;
|
||||
ni->ni_inact_reload = ic->ic_inact_run;
|
||||
}
|
||||
|
||||
void
|
||||
ieee80211_node_unauthorize(struct ieee80211com *ic, struct ieee80211_node *ni)
|
||||
ieee80211_node_unauthorize(struct ieee80211_node *ni)
|
||||
{
|
||||
ni->ni_flags &= ~IEEE80211_NODE_AUTH;
|
||||
}
|
||||
|
|
@ -1048,7 +1050,7 @@ ieee80211_fakeup_adhoc_node(struct ieee80211_node_table *nt,
|
|||
if (ic->ic_newassoc != NULL)
|
||||
ic->ic_newassoc(ic, ni, 1);
|
||||
/* XXX not right for 802.1x/WPA */
|
||||
ieee80211_node_authorize(ic, ni);
|
||||
ieee80211_node_authorize(ni);
|
||||
}
|
||||
return ni;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -182,10 +182,8 @@ ieee80211_node_is_authorized(const struct ieee80211_node *ni)
|
|||
return (ni->ni_flags & IEEE80211_NODE_AUTH);
|
||||
}
|
||||
|
||||
void ieee80211_node_authorize(struct ieee80211com *,
|
||||
struct ieee80211_node *);
|
||||
void ieee80211_node_unauthorize(struct ieee80211com *,
|
||||
struct ieee80211_node *);
|
||||
void ieee80211_node_authorize(struct ieee80211_node *);
|
||||
void ieee80211_node_unauthorize(struct ieee80211_node *);
|
||||
|
||||
void ieee80211_begin_scan(struct ieee80211com *, int);
|
||||
int ieee80211_next_scan(struct ieee80211com *);
|
||||
|
|
|
|||
|
|
@ -1131,7 +1131,7 @@ ieee80211_send_mgmt(struct ieee80211com *ic, struct ieee80211_node *ni,
|
|||
IEEE80211_NODE_STAT(ni, tx_deauth);
|
||||
IEEE80211_NODE_STAT_SET(ni, tx_deauth_code, arg);
|
||||
|
||||
ieee80211_node_unauthorize(ic, ni); /* port closed */
|
||||
ieee80211_node_unauthorize(ni); /* port closed */
|
||||
break;
|
||||
|
||||
case IEEE80211_FC0_SUBTYPE_ASSOC_REQ:
|
||||
|
|
|
|||
|
|
@ -1068,7 +1068,7 @@ ieee80211_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg
|
|||
* at this point so traffic can flow.
|
||||
*/
|
||||
if (ni->ni_authmode != IEEE80211_AUTH_8021X)
|
||||
ieee80211_node_authorize(ic, ni);
|
||||
ieee80211_node_authorize(ni);
|
||||
/*
|
||||
* Enable inactivity processing.
|
||||
* XXX
|
||||
|
|
|
|||
Loading…
Reference in a new issue