Search Linux Wireless

Re: [PATCH 4/5] nl80211/mac80211: allow adding TDLS peers as stations

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

 



On Mon, 2011-09-26 at 13:54 +0300, Arik Nemtsov wrote:

> @@ -811,6 +817,11 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
>  
>  	sta_apply_parameters(local, sta, params);
>  
> +	if (!(wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS) &&
> +	    (sta->flags & WLAN_STA_TDLS_PEER)) {
> +		return -ENOTSUPP;
> +	}

I think this should maybe also make sure that the interface is in
station mode? Otherwise it could get somewhat confusing. Also changes to
the TDLS flag probably shouldn't be allowed.

And this code might also be better in cfg80211, although this is only
with external management, right?

> --- a/net/wireless/nl80211.c
> +++ b/net/wireless/nl80211.c
> @@ -2521,18 +2521,18 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
>  		break;
>  	case NL80211_IFTYPE_P2P_CLIENT:
>  	case NL80211_IFTYPE_STATION:
> -		/* disallow everything but AUTHORIZED flag */
> +		/* disallow things sta doesn't support */
>  		if (params.plink_action)
>  			err = -EINVAL;
>  		if (params.vlan)
>  			err = -EINVAL;
> -		if (params.supported_rates)
> -			err = -EINVAL;

Hmm. Should this be dependent on TLDS somehow?

>  		if (params.ht_capa)
>  			err = -EINVAL;
>  		if (params.listen_interval >= 0)
>  			err = -EINVAL;
> -		if (params.sta_flags_mask & ~BIT(NL80211_STA_FLAG_AUTHORIZED))
> +		if (params.sta_flags_mask &
> +				~(BIT(NL80211_STA_FLAG_AUTHORIZED) |
> +				  BIT(NL80211_STA_FLAG_TDLS_PEER)))

Why is the TDLS flag allowed to change?


> +	/*
> +	 * Managed stations can only add TDLS peers, and only when the
> +	 * wiphy supports it.
> +	 */
> +	if (dev->ieee80211_ptr->iftype == NL80211_IFTYPE_STATION &&
> +	    (!(params.sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)) ||
> +	     !(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_TDLS)))
>  		return -EINVAL;

If the device does full TDLS by itself I don't think we should be
allowed to add/remove stations?



Maybe you need to describe the command sequences a little bit somewhere.
I'm getting a bad feeling about adding stations without supported rates,
and this is only when we have external management etc.

Part of your argument for having the frame sending etc. in the kernel
was that then it's more like managed mode, but all the manual station
handling is very much unlike that.

I'm beginning to think that maybe it should be handled through the TDLS
operations instead, more implicitly?

johannes

--
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 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