linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: fix CMD_FRAME for AP_VLAN
@ 2016-09-25  6:47 Michael Braun
  2016-09-30 11:41 ` Johannes Berg
  2016-10-03 11:31 ` M. Braun
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Braun @ 2016-09-25  6:47 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, projekt-wlan, Michael Braun

When using IEEE 802.11r FT OVER-DS roaming with AP_VLAN, hostapd needs to send
out a frame using CMD_FRAME for a station assigned to an AP_VLAN interface.

Right now, the userspace needs to give the exact AP_VLAN interface index
for CMD_FRAME; hostapd does not do this. Additionally, userspace cannot
use GET_STATION to query the AP_VLAN ifidx, as while GET_STATION finds
stations assigned to AP_VLAN even if the AP iface is queried, it does not
return AP_VLAN ifidx (it returns the queried one).

This breaks IEEE 802.11r over_ds with vlans, as the reply frame does not
get out. This patch fixes this by using get_sta_bss for CMD_FRAME.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
---
 net/mac80211/offchannel.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
index 55a9c5b..2afd329 100644
--- a/net/mac80211/offchannel.c
+++ b/net/mac80211/offchannel.c
@@ -819,7 +819,10 @@ int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
 		    mgmt->u.action.category == WLAN_CATEGORY_SPECTRUM_MGMT)
 			break;
 		rcu_read_lock();
-		sta = sta_info_get(sdata, mgmt->da);
+		if (ieee80211_vif_is_mesh(&sdata->vif))
+			sta = sta_info_get(sdata, mgmt->da);
+		else
+			sta = sta_info_get_bss(sdata, mgmt->da);
 		rcu_read_unlock();
 		if (!sta)
 			return -ENOLINK;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] mac80211: fix CMD_FRAME for AP_VLAN
  2016-09-25  6:47 [PATCH] mac80211: fix CMD_FRAME for AP_VLAN Michael Braun
@ 2016-09-30 11:41 ` Johannes Berg
  2016-10-03 11:03   ` M. Braun
  2016-10-03 11:31 ` M. Braun
  1 sibling, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2016-09-30 11:41 UTC (permalink / raw)
  To: Michael Braun; +Cc: linux-wireless, projekt-wlan


>  net/mac80211/offchannel.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
> index 55a9c5b..2afd329 100644
> --- a/net/mac80211/offchannel.c
> +++ b/net/mac80211/offchannel.c
> @@ -819,7 +819,10 @@ int ieee80211_mgmt_tx(struct wiphy *wiphy,
> struct wireless_dev *wdev,
>  		    mgmt->u.action.category ==
> WLAN_CATEGORY_SPECTRUM_MGMT)
>  			break;
>  		rcu_read_lock();
> -		sta = sta_info_get(sdata, mgmt->da);
> +		if (ieee80211_vif_is_mesh(&sdata->vif))
> +			sta = sta_info_get(sdata, mgmt->da);
> +		else
> +			sta = sta_info_get_bss(sdata, mgmt->da);
> 
I don't see why you need to distinguish between mesh and non-mesh here?
get_bss() will ignore the BSS pointer if it's NULL, and that will
always be the case when the type is mesh, so ... why?

johannes

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mac80211: fix CMD_FRAME for AP_VLAN
  2016-09-30 11:41 ` Johannes Berg
@ 2016-10-03 11:03   ` M. Braun
  0 siblings, 0 replies; 5+ messages in thread
From: M. Braun @ 2016-10-03 11:03 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, projekt-wlan

Am 30.09.2016 um 13:41 schrieb Johannes Berg:
>> -		sta = sta_info_get(sdata, mgmt->da);
>> +		if (ieee80211_vif_is_mesh(&sdata->vif))
>> +			sta = sta_info_get(sdata, mgmt->da);
>> +		else
>> +			sta = sta_info_get_bss(sdata, mgmt->da);
>>
> I don't see why you need to distinguish between mesh and non-mesh
> here?
> get_bss() will ignore the BSS pointer if it's NULL, and that will
> always be the case when the type is mesh, so ... why?

because the in ieee80211_mgmt_tx the

>        case NL80211_IFTYPE_AP:
>        case NL80211_IFTYPE_AP_VLAN:
>        case NL80211_IFTYPE_P2P_GO:
> ...
>                rcu_read_lock();
>                if (ieee80211_vif_is_mesh(&sdata->vif))
>                        sta = sta_info_get(sdata, mgmt->da);
>                else
>                        sta = sta_info_get_bss(sdata, mgmt->da);
>                rcu_read_unlock();
>

does it the same way and I wanted to go safe and not change the mesh path.

michael

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mac80211: fix CMD_FRAME for AP_VLAN
  2016-09-25  6:47 [PATCH] mac80211: fix CMD_FRAME for AP_VLAN Michael Braun
  2016-09-30 11:41 ` Johannes Berg
@ 2016-10-03 11:31 ` M. Braun
  2016-10-04  8:19   ` Johannes Berg
  1 sibling, 1 reply; 5+ messages in thread
From: M. Braun @ 2016-10-03 11:31 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, projekt-wlan

Am 03.10.2016 um 13:03 schrieb M. Braun:
> because the in ieee80211_mgmt_tx the

ups, that was the patch itself.

I think I carried it over from ieee80211_add_key, that does

>
>        if (mac_addr) {
>                if (ieee80211_vif_is_mesh(&sdata->vif))
>                        sta = sta_info_get(sdata, mac_addr);
>                else
>                        sta = sta_info_get_bss(sdata, mac_addr);
>

Regards,
M. Braun

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mac80211: fix CMD_FRAME for AP_VLAN
  2016-10-03 11:31 ` M. Braun
@ 2016-10-04  8:19   ` Johannes Berg
  0 siblings, 0 replies; 5+ messages in thread
From: Johannes Berg @ 2016-10-04  8:19 UTC (permalink / raw)
  To: M. Braun; +Cc: linux-wireless, projekt-wlan

On Mon, 2016-10-03 at 13:31 +0200, M. Braun wrote:
> Am 03.10.2016 um 13:03 schrieb M. Braun:
> > 
> > because the in ieee80211_mgmt_tx the
> 
> ups, that was the patch itself.
> 
> I think I carried it over from ieee80211_add_key, that does
> 
> > 
> > 
> >        if (mac_addr) {
> >                if (ieee80211_vif_is_mesh(&sdata->vif))
> >                        sta = sta_info_get(sdata, mac_addr);
> >                else
> >                        sta = sta_info_get_bss(sdata, mac_addr);
> > 
> 

Ok, so that's there, but I still don't see the point - sta->sdata->bss
will be NULL for any mesh STA.

Thomas, do you remember anything about why you did this back in commit
ff973af74aa6932ca4758266bccec68e8135ddf7
Author: Thomas Pedersen <thomas@cozybit.com>
Date:   Tue May 3 16:57:12 2011 -0700

    nl80211: allow installing keys for a meshif

?

(yeah, long shot, it's 5.5 years ago ...)

johannes

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-10-04  8:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-25  6:47 [PATCH] mac80211: fix CMD_FRAME for AP_VLAN Michael Braun
2016-09-30 11:41 ` Johannes Berg
2016-10-03 11:03   ` M. Braun
2016-10-03 11:31 ` M. Braun
2016-10-04  8:19   ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).