aboutsummaryrefslogtreecommitdiffstats
path: root/src/ap/accounting.h
diff options
context:
space:
mode:
authorNick Lowe <nick.lowe@lugatech.com>2016-01-24 11:37:46 (GMT)
committerJouni Malinen <j@w1.fi>2016-02-06 15:10:19 (GMT)
commitd72a00539ca793ecd3137ae308bc173271d8b882 (patch)
treef0f9f7c3e65e08d0a597bf42bdff9daeb3a84746 /src/ap/accounting.h
parentd689317ddbf58487432951a4afb2f4070eeb10b6 (diff)
downloadhostap-d72a00539ca793ecd3137ae308bc173271d8b882.zip
hostap-d72a00539ca793ecd3137ae308bc173271d8b882.tar.gz
hostap-d72a00539ca793ecd3137ae308bc173271d8b882.tar.bz2
RADIUS: Use more likely unique accounting Acct-{,Multi-}Session-Id
Rework the Acct-Session-Id and Acct-Multi-Session-Id implementation to give better global and temporal uniqueness. Previously, only 32-bits of the Acct-Session-Id would contain random data, the other 32-bits would be incremented. Previously, the Acct-Multi-Session-Id would not use random data. Switch from two u32 variables to a single u64 for the Acct-Session-Id and Acct-Multi-Session-Id. Do not increment, this serves no legitimate purpose. Exclusively use os_get_random() to get quality random numbers, do not use or mix in the time. Inherently take a dependency on /dev/urandom working properly therefore. Remove the global Acct-Session-Id and Acct-Multi-Session-Id values that serve no legitimate purpose. Signed-off-by: Nick Lowe <nick.lowe@lugatech.com>
Diffstat (limited to 'src/ap/accounting.h')
-rw-r--r--src/ap/accounting.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ap/accounting.h b/src/ap/accounting.h
index dcc54ee..de5a33f 100644
--- a/src/ap/accounting.h
+++ b/src/ap/accounting.h
@@ -10,9 +10,10 @@
#define ACCOUNTING_H
#ifdef CONFIG_NO_ACCOUNTING
-static inline void accounting_sta_get_id(struct hostapd_data *hapd,
- struct sta_info *sta)
+static inline int accounting_sta_get_id(struct hostapd_data *hapd,
+ struct sta_info *sta)
{
+ return 0;
}
static inline void accounting_sta_start(struct hostapd_data *hapd,
@@ -34,7 +35,7 @@ static inline void accounting_deinit(struct hostapd_data *hapd)
{
}
#else /* CONFIG_NO_ACCOUNTING */
-void accounting_sta_get_id(struct hostapd_data *hapd, struct sta_info *sta);
+int accounting_sta_get_id(struct hostapd_data *hapd, struct sta_info *sta);
void accounting_sta_start(struct hostapd_data *hapd, struct sta_info *sta);
void accounting_sta_stop(struct hostapd_data *hapd, struct sta_info *sta);
int accounting_init(struct hostapd_data *hapd);