Search Linux Wireless

Re: [PATCH] cfg80211: properly send NL80211_ATTR_DISCONNECTED_BY_AP in disconnect

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

 



On Fri, 2015-05-22 at 16:25 +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@xxxxxxxxx>
> 
> When we disconnect from the AP, drivers call cfg80211_disconnect().
> This doesn't know whether the disconnection was initiated locally
> or by the AP though, which can cause problems with the supplicant,
> for example with WPS. This issue obviously doesn't show up with any
> mac80211 based driver since mac80211 doesn't call this function.
> 
> Fix this by requiring drivers to indicate whether the disconnect is
> locally generated or not. I've tried to update the drivers, but may
> not have gotten the values correct, and some drivers may currently
> not be able to report correct values. In case of doubt I left it at
> false, which is the current behaviour.
> 
> Reported-by: Matthieu Mauger <matthieux.mauger@xxxxxxxxx>
> Tested-by: Matthieu Mauger <matthieux.mauger@xxxxxxxxx>
> Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
> ---
>  drivers/net/wireless/ath/ath6kl/cfg80211.c         | 4 ++--
>  drivers/net/wireless/ath/wil6210/main.c            | 2 +-
>  drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 4 ++--
>  drivers/net/wireless/libertas/cfg.c                | 4 ++--
>  drivers/net/wireless/mwifiex/join.c                | 2 +-
>  drivers/net/wireless/mwifiex/sta_event.c           | 2 +-
>  drivers/net/wireless/rndis_wlan.c                  | 2 +-
>  drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c  | 2 +-
>  drivers/staging/wlan-ng/cfg80211.c                 | 2 +-
>  include/net/cfg80211.h                             | 4 +++-
>  net/wireless/core.h                                | 1 +
>  net/wireless/sme.c                                 | 4 +++-
>  net/wireless/util.c                                | 3 ++-
>  13 files changed, 21 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
> index 1a4d558022d8..9e3e3176670b 100644
> --- a/drivers/net/wireless/libertas/cfg.c
> +++ b/drivers/net/wireless/libertas/cfg.c
> @@ -841,7 +841,7 @@ void lbs_send_disconnect_notification(struct lbs_private *priv)
>  
>  	cfg80211_disconnected(priv->dev,
>  		0,
> -		NULL, 0,
> +		NULL, 0, false,
>  		GFP_KERNEL);

lbs_send_disconnect_notification() could use a 'bool locally_generated'
parameter that gets passed directly to cfg80211_disconnected(), which in
turn gets passed through from a new 'bool locally_generated' parameter
for lbs_mac_event_disconnected() (which is the only caller of
lbs_send_disconnect_notification).

The calls to lbs_mac_event_disconnected() would pass these values:

lbs_leave_ibss(): true
lbs_process_event(): MACREG_INT_CODE_DEAUTHENTICATED: false
lbs_process_event(): MACREG_INT_CODE_DISASSOCIATED: false
lbs_process_event(): MACREG_INT_CODE_LINK_LOST_NO_SCAN: true
 
>  	lbs_deb_leave(LBS_DEB_CFG80211);
> @@ -1458,7 +1458,7 @@ int lbs_disconnect(struct lbs_private *priv, u16 reason)
>  
>  	cfg80211_disconnected(priv->dev,
>  			reason,
> -			NULL, 0,
> +			NULL, 0, true,
>  			GFP_KERNEL);
>  	priv->connect_status = LBS_DISCONNECTED;

This one is correct.

Dan


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux