[PATCH RFC] AP: Allow using existing interfaces for all BSS-es

Jouni Malinen j at w1.fi
Mon May 30 07:50:48 PDT 2016


On Mon, May 30, 2016 at 08:53:13AM +0200, Rafał Miłecki wrote:
> Some drivers (e.g. brcmfmac) may not support deleting virtual
> interfaces. In such cases we can start AP interfaces once only. This can
> be easily workarounded by allowing driver(s) to use all existing
> interfaces.

> This patch allows me freely use BCM4366 with brcmfmac and multiple AP
> interfaces. Unfortunately I don't know reason for having this limiration
> in the first place. Do you know if my patch may break anything?

This would leave hapd->interface_added == 1 even for interfaces that
were not added by hostapd. hostapd_free_hapd_data() would then try to
remove this interface which would apparently fail with this driver.

> diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
> @@ -941,7 +941,7 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
>  				   conf->iface, addr, hapd,
>  				   &hapd->drv_priv, force_ifname, if_addr,
>  				   conf->bridge[0] ? conf->bridge : NULL,
> -				   first == -1)) {
> +				   true)) {
>  			wpa_printf(MSG_ERROR, "Failed to add BSS (BSSID="
>  				   MACSTR ")", MAC2STR(hapd->own_addr));
>  			hapd->interface_added = 0;

Maybe this should first try first == -1 and if that fails, try with
use_existing parameter value 1 ("true" is not used within most places of
hostapd yet) and if that succeeds, allow operation to continue but with
hapd->interface_added = 0.
 
-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list