Re: [PATCH] Make rx_bytes and tx_bytes 64-bit rather than 32-bit.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Feb 13, 2016 at 03:09:14PM +0000, Nick Lowe wrote:
> Make rx_bytes and tx_bytes 64-bit rather than 32-bit. Rework RADIUS
> accounting to use these for Acct-Input-Octets, Acct-Input-Gigawords,
> Acct-Output-Octets and Acct-Output-Gigawords. Remove the race
> vulnerable 32-bit value wrap/overflow detection code.

> diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
> @@ -5340,10 +5340,10 @@ static int get_sta_handler(struct nl_msg *msg,
> -    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->tx_bytes = nla_get_u32(stats[NL80211_STA_INFO_TX_BYTES]);
> +    if (stats[NL80211_STA_INFO_RX_BYTES64])
> +        data->rx_bytes = nla_get_u64(stats[NL80211_STA_INFO_RX_BYTES64]);
> +    if (stats[NL80211_STA_INFO_TX_BYTES64])
> +        data->tx_bytes = nla_get_u64(stats[NL80211_STA_INFO_TX_BYTES64]);

This would break support for older kernel versions. While we might
eventually be able to drop support for the 32-bit TX/RX byte attributes,
it would probably be best to do this in two steps, i.e., the commit here
should check if the TX/RX_BYTES64 attribute exists and if so, use the
value from there. If those attributes were not present, fall back to
using the older 32-bit versions.
 
-- 
Jouni Malinen                                            PGP id EFC895FA

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux