[PATCH v2 1/2] Included session transfer stats (rx/tx packets/bytes) and duration into the station's "deauthentiation"-log message.

Jouni Malinen j at w1.fi
Sun Jan 6 13:35:14 EST 2013


On Wed, Jan 02, 2013 at 02:57:05PM +0100, Jan Vales wrote:
> diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
> @@ -1374,8 +1376,21 @@ static void handle_deauth(struct hostapd_data *hapd,
>  	sta->flags &= ~(WLAN_STA_AUTH | WLAN_STA_ASSOC |
>  			WLAN_STA_ASSOC_REQ_OK);
>  	wpa_auth_sm_event(sta->wpa_sm, WPA_DEAUTH);
> -	hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
> -		       HOSTAPD_LEVEL_DEBUG, "deauthenticated");
> +
> +	if (hostapd_drv_read_sta_data(hapd, &data, sta->addr) == 0) {

This does not look like the correct place to do this. This function is
called only if the station send Deauthentication frame to the AP. This
may not happen, i.e., the station may use Disassociation frame or just
go out of range from the AP without sending any frame. If this type of
log information is desired, I would assume it would be desired for all
different ways of a station getting disconnected. In other words, this
would need to be done in the same place as account_sta_stop().

I know you mentioned that you did not want to modify the RADIUS
accounting code for this, but that would likely be the best place for
doing this. This takes care of the counter wrapping and there is already
a hostapd_logger() call in accounting_sta_update_stats() for that
matter.

-- 
Jouni Malinen                                            PGP id EFC895FA


More information about the HostAP mailing list