diff mbox

[2/7] mac80211: treat IBSS CSA finish failure seriously

Message ID 1390227670-19030-3-git-send-email-michal.kazior@tieto.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Michal Kazior Jan. 20, 2014, 2:21 p.m. UTC
Other interface modes are checked against failure.
This should avoid false-positive channel switch
events where IBSS CSA actually failed.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
 net/mac80211/cfg.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Johannes Berg Jan. 21, 2014, 3 p.m. UTC | #1
On Mon, 2014-01-20 at 15:21 +0100, Michal Kazior wrote:
> Other interface modes are checked against failure.
> This should avoid false-positive channel switch
> events where IBSS CSA actually failed.
> 
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
> ---
>  net/mac80211/cfg.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
> index 62bf6c4..76fe1f90 100644
> --- a/net/mac80211/cfg.c
> +++ b/net/mac80211/cfg.c
> @@ -3039,7 +3039,9 @@ static void ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
>  			return;
>  		break;
>  	case NL80211_IFTYPE_ADHOC:
> -		ieee80211_ibss_finish_csa(sdata);
> +		err = ieee80211_ibss_finish_csa(sdata);
> +		if (err < 0)
> +			return;

Looks fine, though I suppose this should then perhaps also return a
changed bitmap to be used later. Ditto for mesh, I guess.

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Luca Coelho Jan. 22, 2014, 11:38 a.m. UTC | #2
On Tue, 2014-01-21 at 16:00 +0100, Johannes Berg wrote:
> On Mon, 2014-01-20 at 15:21 +0100, Michal Kazior wrote:
> > Other interface modes are checked against failure.
> > This should avoid false-positive channel switch
> > events where IBSS CSA actually failed.
> > 
> > Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
> > ---
> >  net/mac80211/cfg.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
> > index 62bf6c4..76fe1f90 100644
> > --- a/net/mac80211/cfg.c
> > +++ b/net/mac80211/cfg.c
> > @@ -3039,7 +3039,9 @@ static void ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
> >  			return;
> >  		break;
> >  	case NL80211_IFTYPE_ADHOC:
> > -		ieee80211_ibss_finish_csa(sdata);
> > +		err = ieee80211_ibss_finish_csa(sdata);
> > +		if (err < 0)
> > +			return;
> 
> Looks fine, though I suppose this should then perhaps also return a
> changed bitmap to be used later. Ditto for mesh, I guess.

Yes, I agree.  I actually had started to work on some patches to align
all this, but I'll leave it to Michal. ;)

--
Luca.

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

Patch

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 62bf6c4..76fe1f90 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3039,7 +3039,9 @@  static void ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
 			return;
 		break;
 	case NL80211_IFTYPE_ADHOC:
-		ieee80211_ibss_finish_csa(sdata);
+		err = ieee80211_ibss_finish_csa(sdata);
+		if (err < 0)
+			return;
 		break;
 #ifdef CONFIG_MAC80211_MESH
 	case NL80211_IFTYPE_MESH_POINT: