* [PATCH] mac80211: mesh: fix mesh_id check
@ 2014-01-21 20:04 Johannes Berg
2014-01-22 6:45 ` Chun-Yeow Yeoh
0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2014-01-21 20:04 UTC (permalink / raw)
To: linux-wireless; +Cc: Chun-Yeow Yeoh
From: Johannes Berg <johannes.berg@intel.com>
The mesh_id is an array so can't ever be NULL, it looks
like mesh_id_len check was intended instead.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/cfg.c | 2 +-
net/mac80211/mesh.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index db17c9c..cd14bef 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3108,7 +3108,7 @@ static int ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
case NL80211_IFTYPE_MESH_POINT:
ifmsh = &sdata->u.mesh;
- if (!ifmsh->mesh_id)
+ if (!ifmsh->mesh_id_len)
return -EINVAL;
if (params->chandef.width != sdata->vif.bss_conf.chandef.width)
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index ba10525..59f6243 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -866,7 +866,7 @@ ieee80211_mesh_process_chnswitch(struct ieee80211_sub_if_data *sdata,
if (sdata->vif.csa_active)
return true;
- if (!ifmsh->mesh_id)
+ if (!ifmsh->mesh_id_len)
return false;
sta_flags = IEEE80211_STA_DISABLE_VHT;
--
1.8.5.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] mac80211: mesh: fix mesh_id check
2014-01-21 20:04 [PATCH] mac80211: mesh: fix mesh_id check Johannes Berg
@ 2014-01-22 6:45 ` Chun-Yeow Yeoh
2014-01-22 8:21 ` Johannes Berg
0 siblings, 1 reply; 5+ messages in thread
From: Chun-Yeow Yeoh @ 2014-01-22 6:45 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Yeoh Chun-Yeow, Javier Cardona
Hi, Johannes
Thanks for pointing out.
> @@ -866,7 +866,7 @@ ieee80211_mesh_process_chnswitch(struct ieee80211_sub_if_data *sdata,
> if (sdata->vif.csa_active)
> return true;
>
> - if (!ifmsh->mesh_id)
> + if (!ifmsh->mesh_id_len)
I don't see this in mac80211-next. Anyway, I think that this is not
needed since the checking (sdata->wdev.mesh_id_len) is done at
ieee80211_mesh_rx_queued_mgmt prior to
ieee80211_mesh_process_chnswitch.
---
Chun-Yeow
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mac80211: mesh: fix mesh_id check
2014-01-22 6:45 ` Chun-Yeow Yeoh
@ 2014-01-22 8:21 ` Johannes Berg
2014-01-22 9:59 ` Yeoh Chun-Yeow
0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2014-01-22 8:21 UTC (permalink / raw)
To: Chun-Yeow Yeoh; +Cc: linux-wireless, Yeoh Chun-Yeow, Javier Cardona
On Wed, 2014-01-22 at 14:45 +0800, Chun-Yeow Yeoh wrote:
> > @@ -866,7 +866,7 @@ ieee80211_mesh_process_chnswitch(struct ieee80211_sub_if_data *sdata,
> > if (sdata->vif.csa_active)
> > return true;
> >
> > - if (!ifmsh->mesh_id)
> > + if (!ifmsh->mesh_id_len)
>
> I don't see this in mac80211-next. Anyway, I think that this is not
> needed since the checking (sdata->wdev.mesh_id_len) is done at
> ieee80211_mesh_rx_queued_mgmt prior to
> ieee80211_mesh_process_chnswitch.
Indeed, this part seems to only be in 3.13 - probably got cleaned up in
somebody else's patches. I think though mac80211 should probably check
ifmsh->mesh_id_len and not sdata->wdev.mesh_id_len? Also, cfg80211 seems
to be missing this check in nl80211_channel_switch(), no?
johannes
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mac80211: mesh: fix mesh_id check
2014-01-22 8:21 ` Johannes Berg
@ 2014-01-22 9:59 ` Yeoh Chun-Yeow
2014-01-22 10:09 ` Johannes Berg
0 siblings, 1 reply; 5+ messages in thread
From: Yeoh Chun-Yeow @ 2014-01-22 9:59 UTC (permalink / raw)
To: Johannes Berg; +Cc: Chun-Yeow Yeoh, linux-wireless, Javier Cardona
> Indeed, this part seems to only be in 3.13 - probably got cleaned up in
> somebody else's patches. I think though mac80211 should probably check
> ifmsh->mesh_id_len and not sdata->wdev.mesh_id_len?
Agreed.
> Also, cfg80211 seems to be missing this check in nl80211_channel_switch(), no?
This checking is required for FullMAC implementation, right?
---
Chun-Yeow
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mac80211: mesh: fix mesh_id check
2014-01-22 9:59 ` Yeoh Chun-Yeow
@ 2014-01-22 10:09 ` Johannes Berg
0 siblings, 0 replies; 5+ messages in thread
From: Johannes Berg @ 2014-01-22 10:09 UTC (permalink / raw)
To: Yeoh Chun-Yeow; +Cc: Chun-Yeow Yeoh, linux-wireless, Javier Cardona
On Wed, 2014-01-22 at 17:59 +0800, Yeoh Chun-Yeow wrote:
> > Also, cfg80211 seems to be missing this check in nl80211_channel_switch(), no?
> This checking is required for FullMAC implementation, right?
Which is unlikely to support it, but generally it seems better to do it
closer to userspace. I've posted a patch for it.
johannes
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-01-22 10:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-21 20:04 [PATCH] mac80211: mesh: fix mesh_id check Johannes Berg
2014-01-22 6:45 ` Chun-Yeow Yeoh
2014-01-22 8:21 ` Johannes Berg
2014-01-22 9:59 ` Yeoh Chun-Yeow
2014-01-22 10:09 ` 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).