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.
This commit is contained in:
Jouni Malinen 2009-02-16 13:28:42 +02:00 committed by Jouni Malinen
parent 8a0eae80ac
commit dbdf58b053
2 changed files with 4 additions and 1 deletions

View file

@ -6,6 +6,8 @@ ChangeLog for hostapd
* driver_nl80211: use Linux socket filter to improve performance
* added support for external Registrars with WPS (UPnP transport)
* 802.11n: scan for overlapping BSSes before starting 20/40 MHz channel
* driver_nl80211: fixed STA accounting data collection (TX/RX bytes
reported correctly; TX/RX packets not yet available from kernel)
2009-01-06 - v0.6.7
* added support for Wi-Fi Protected Setup (WPS)

View file

@ -718,7 +718,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;
}
@ -729,6 +729,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;