diff options
author | Jouni Malinen <j@w1.fi> | 2014-10-18 07:20:24 (GMT) |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2014-10-18 07:38:17 (GMT) |
commit | fcc306e3cc714ca54a02176db1da366786b01147 (patch) | |
tree | b50ef186dac6d675b9c675192ce6cbbf1e97d237 /src/eapol_auth/eapol_auth_sm.c | |
parent | aff039fada2f10b0956312a53e1484b73314daa2 (diff) | |
download | hostap-fcc306e3cc714ca54a02176db1da366786b01147.zip hostap-fcc306e3cc714ca54a02176db1da366786b01147.tar.gz hostap-fcc306e3cc714ca54a02176db1da366786b01147.tar.bz2 |
Add Acct-Multi-Session-Id into RADIUS Accounting messages
This allows multiple sessions using the same PMKSA cache entry to be
combined more easily at the server side. Acct-Session-Id is still a
unique identifier for each association, while Acct-Multi-Session-Id will
maintain its value for all associations that use the same PMKSA.
Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/eapol_auth/eapol_auth_sm.c')
-rw-r--r-- | src/eapol_auth/eapol_auth_sm.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/eapol_auth/eapol_auth_sm.c b/src/eapol_auth/eapol_auth_sm.c index a76fa13..8584cf0 100644 --- a/src/eapol_auth/eapol_auth_sm.c +++ b/src/eapol_auth/eapol_auth_sm.c @@ -851,6 +851,11 @@ eapol_auth_alloc(struct eapol_authenticator *eapol, const u8 *addr, sm->radius_cui = wpabuf_alloc_copy(radius_cui, os_strlen(radius_cui)); + sm->acct_multi_session_id_lo = eapol->acct_multi_session_id_lo++; + if (eapol->acct_multi_session_id_lo == 0) + eapol->acct_multi_session_id_hi++; + sm->acct_multi_session_id_hi = eapol->acct_multi_session_id_hi; + return sm; } @@ -1127,6 +1132,7 @@ struct eapol_authenticator * eapol_auth_init(struct eapol_auth_config *conf, struct eapol_auth_cb *cb) { struct eapol_authenticator *eapol; + struct os_time now; eapol = os_zalloc(sizeof(*eapol)); if (eapol == NULL) @@ -1153,6 +1159,12 @@ struct eapol_authenticator * eapol_auth_init(struct eapol_auth_config *conf, eapol->cb.tx_key = cb->tx_key; eapol->cb.eapol_event = cb->eapol_event; + /* Acct-Multi-Session-Id should be unique over reboots. If reliable + * clock is not available, this could be replaced with reboot counter, + * etc. */ + os_get_time(&now); + eapol->acct_multi_session_id_hi = now.sec; + return eapol; } |