diff options
authorJouni Malinen <jouni.malinen@atheros.com>2009-02-16 11:28:42 (GMT)
committerJouni Malinen <j@w1.fi>2009-02-27 10:30:23 (GMT)
commitf2f4bc58eb3e9f4fbfea7c7c4d5460233f08828a (patch)
parentf43ec7f8131036bd329f06c78723d477c4838c76 (diff)
driver_nl80211: Fix STA accounting data collection
TX/RX bytes are now reported correctly (typo ended up leaving TX bytes uninitialized and set RX bytes value to use correct TX bytes). TX/RX packet counts are not yet available from kernel, so we have to clear the values to avoid reporting bogus data. (cherry picked from commit dbdf58b053e4b839ec05ee19d73f96a448f1a863) Conflicts: hostapd/ChangeLog
2 files changed, 6 insertions, 1 deletions
diff --git a/hostapd/ChangeLog b/hostapd/ChangeLog
index 46f0852..3918aa3 100644
--- a/hostapd/ChangeLog
+++ b/hostapd/ChangeLog
@@ -1,5 +1,9 @@
ChangeLog for hostapd
+????-??-?? - v0.6.9
+ * driver_nl80211: fixed STA accounting data collection (TX/RX bytes
+ reported correctly; TX/RX packets not yet available from kernel)
2009-02-15 - v0.6.8
* increased hostapd_cli ping interval to 5 seconds and made this
configurable with a new command line options (-G<seconds>)
diff --git a/hostapd/driver_nl80211.c b/hostapd/driver_nl80211.c
index fd01d3d..6a9e4cf 100644
--- a/hostapd/driver_nl80211.c
+++ b/hostapd/driver_nl80211.c
@@ -710,7 +710,7 @@ static int get_sta_handler(struct nl_msg *msg, void *arg)
if (stats[NL80211_STA_INFO_RX_BYTES])
data->rx_bytes = nla_get_u32(stats[NL80211_STA_INFO_RX_BYTES]);
if (stats[NL80211_STA_INFO_TX_BYTES])
- data->rx_bytes = nla_get_u32(stats[NL80211_STA_INFO_TX_BYTES]);
+ data->tx_bytes = nla_get_u32(stats[NL80211_STA_INFO_TX_BYTES]);
return NL_SKIP;
@@ -721,6 +721,7 @@ static int i802_read_sta_data(void *priv, struct hostap_sta_driver_data *data,
struct i802_driver_data *drv = priv;
struct nl_msg *msg;
+ os_memset(data, 0, sizeof(*data));
msg = nlmsg_alloc();
if (!msg)
return -ENOMEM;