driver_nl80211: Fix STA accounting data collection
authorJouni Malinen <jouni.malinen@atheros.com>
Mon, 16 Feb 2009 11:28:42 +0000 (13:28 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 16 Feb 2009 11:28:42 +0000 (13:28 +0200)
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.

hostapd/ChangeLog
hostapd/driver_nl80211.c

index 17ebc3b..3a1c2a9 100644 (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)
index 3cb74d1..f09f5b5 100644 (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;