Search Linux Wireless

Re: [PATCH] mac80211: fix managed mode BSSID handling

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

 



On Mon, 2009-05-18 at 15:20 -0400, John W. Linville wrote:

> --- a/net/mac80211/main.c
> +++ b/net/mac80211/main.c
> @@ -157,20 +157,28 @@ int ieee80211_if_config(struct ieee80211_sub_if_data *sdata, u32 changed)
>  {
>  	struct ieee80211_local *local = sdata->local;
>  	struct ieee80211_if_conf conf;
> +	static const u8 zero[ETH_ALEN] = { 0 };
>  
>  	if (WARN_ON(!netif_running(sdata->dev)))
>  		return 0;
>  
>  	memset(&conf, 0, sizeof(conf));
>  
> -	if (sdata->vif.type == NL80211_IFTYPE_STATION)
> -		conf.bssid = sdata->u.mgd.bssid;
> -	else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
> +	if (sdata->vif.type == NL80211_IFTYPE_STATION) {
> +		/*
> +		 * While not associated, claim a BSSID of all-zeroes
> +		 * so that drivers don't do any weird things with the
> +		 * BSSID at that time.
> +		 */
> +		if (sdata->vif.bss_conf.assoc)
> +			sdata->vif.bss_conf.bssid = sdata->u.mgd.bssid;
> +		else
> +			sdata->vif.bss_conf.bssid = zero;
> +	} else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
>  		conf.bssid = sdata->u.ibss.bssid;
>  	else if (sdata->vif.type == NL80211_IFTYPE_AP)
>  		conf.bssid = sdata->dev->dev_addr;
>  	else if (ieee80211_vif_is_mesh(&sdata->vif)) {
> -		static const u8 zero[ETH_ALEN] = { 0 };
>  		conf.bssid = zero;
>  	} else {
>  		WARN_ON(1);

Yes, this looks correct, thanks. The difference is just due to the
config_interface vs. bss_info_changed change.

johannes

Attachment: signature.asc
Description: This is a digitally signed message part


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