Search Linux Wireless

Re: mac80211 regression: doesn't associate automatically

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

 



> It doesn't look like it should be so hard to make setting the key
> trigger association. And I don't think that if we allow setting the
> key to trigger association, that it obligates us to reassociate on
> every other event that could effect it. As you said, wext spec is
> silent on this matter.
> 
> It does seem silly to set the key after the essid, but unless it
> really hurts elsewhere, we can be liberal in what we accept.
> 
> My (probably wrong, compile-tested only, for review only) patch to
> implement this:

I don't think this can work because when say wpa_supplicant changes the
key the last thing we want is to have that cause a reconsideration of
which AP we're associated with. Or even a disassoc/reassoc cycle.

> I know it is word-wrapped by Gmail. Sorry, I'm late to a family event as-is.
> 
> diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c
> index 503b64a..6ce79e4 100644
> --- a/net/mac80211/ieee80211_ioctl.c
> +++ b/net/mac80211/ieee80211_ioctl.c
> @@ -839,6 +839,7 @@ static int ieee80211_ioctl_siwencode(struct net_device *dev,
>  	int idx, i, alg = ALG_WEP;
>  	u8 bcaddr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
>  	int remove = 0;
> +	int ret;
> 
>  	sdata = IEEE80211_DEV_TO_SUB_IF(dev);
> 
> @@ -864,11 +865,16 @@ static int ieee80211_ioctl_siwencode(struct
> net_device *dev,
>  		return 0;
>  	}
> 
> -	return ieee80211_set_encryption(
> +	ret = ieee80211_set_encryption(
>  		dev, bcaddr,
>  		idx, alg, remove,
>  		!sdata->default_key,
>  		keybuf, erq->length);
> +	if (ret)
> +		return ret;
> +
> +	ieee80211_sta_req_auth(dev, &sdata->u.sta);
> +	return 0;
>  }
> 
> 
> @@ -1015,6 +1021,7 @@ static int ieee80211_ioctl_siwencodeext(struct
> net_device *dev,
>  	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
>  	struct iw_encode_ext *ext = (struct iw_encode_ext *) extra;
>  	int uninitialized_var(alg), idx, i, remove = 0;
> +	int ret;
> 
>  	switch (ext->alg) {
>  	case IW_ENCODE_ALG_NONE:
> @@ -1052,11 +1059,16 @@ static int ieee80211_ioctl_siwencodeext(struct
> net_device *dev,
>  	} else
>  		idx--;
> 
> -	return ieee80211_set_encryption(dev, ext->addr.sa_data, idx, alg,
> +	ret = ieee80211_set_encryption(dev, ext->addr.sa_data, idx, alg,
>  					remove,
>  					ext->ext_flags &
>  					IW_ENCODE_EXT_SET_TX_KEY,
>  					ext->key, ext->key_len);
> +	if (ret)
> +		return ret;
> +
> +	ieee80211_sta_req_auth(dev, &sdata->u.sta);
> +	return 0;
>  }
> 

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