[RFC 06/13] TDLS: support sending a teardown frame from usermode

Johannes Berg johannes at sipsolutions.net
Thu Sep 15 07:15:44 EDT 2011


On Thu, 2011-09-15 at 13:22 +0300, Arik Nemtsov wrote:
> When a driver does not implement the TDLS_TEARDOWN operation internally,
> send an explicit TDLS link teardown frame to the driver.
> 
> Change all teardown calls to use this fallback mechanism.
> 
> Signed-off-by: Arik Nemtsov <arik at wizery.com>
> Cc: Kalyan C Gaddam <chakkal at iit.edu>
> ---
>  src/rsn_supp/tdls.c     |   62 +++++++++++++++++++++++++++++++++++++++-------
>  src/rsn_supp/wpa.h      |    4 +-
>  wpa_supplicant/events.c |    5 +--
>  3 files changed, 56 insertions(+), 15 deletions(-)
> 
> diff --git a/src/rsn_supp/tdls.c b/src/rsn_supp/tdls.c
> index 49c4c4c..b4f17db 100644
> --- a/src/rsn_supp/tdls.c
> +++ b/src/rsn_supp/tdls.c
> @@ -255,6 +255,27 @@ static int wpa_tdls_tpk_send(struct wpa_sm *sm, const u8 *dest, u8 action_code,
>  }
>  
> 
> +static int wpa_tdls_do_teardown(struct wpa_sm *sm, struct wpa_tdls_peer *peer,
> +				u16 reason_code)
> +{
> +	/* try asking the driver to teardown the link */
> +	int ret = wpa_sm_tdls_oper(sm, TDLS_TEARDOWN, peer->addr);
> +
> +	/* it it doesn't work - send an explicit teardown message */
> +	if (ret) {

I think that should be a feature flag rather than always trying &
falling back.

johannes



More information about the HostAP mailing list