[PATCH] hostapd: Disconnect STA when it fails to get added in kernel driver/firmware

Jouni Malinen j
Sat Oct 15 02:43:37 PDT 2011

On Thu, Oct 13, 2011 at 05:00:24PM +0530, Yogesh Ashok Powar wrote:
> Data path for stations that get successfully associated to the
> hostapd but fail to get added in the driver/firmware, will not
> work. In such cases, hostapd should deauth and disconnect such
> stations. In such scenario, hostapd should disconnect the STAs.

Thanks, applied.

> +++ b/src/ap/ieee802_11.c
> @@ -1714,6 +1714,11 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
>  		hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
>  			       "Could not add STA to kernel driver");
> +
> +		ap_sta_disconnect(hapd, sta, sta->addr,
> +
> +		return;

Though, I replaced that return with "goto fail" to make sure any cleanup
steps get completed on this error path.

Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list