The attached patch causes madwifi to send out a custom iwevent when a node disassociates from an access point. This event contains the latest statistics (traffic counters) for the node at the time it leaves the AP.
If this event is not sent daemons like hostapd loose the ability to create accounting records for any traffic that occured since they last polled the driver. In a default configuration this may be up to five minutes of traffic.
The format of iwevent is not standardised anywhere that I know of, so I have simply formatted it according to what hostapd is expecting to receive.
Signed-off-by: Matt Brown <matt@mattb.net.nz>