Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Thomas Pedersen <thomas@cozybit.com>
Cc: linux-wireless@vger.kernel.org, j@w1.fi
Subject: Re: [PATCH v3] cfg80211: clean up mesh plink station change API
Date: Fri, 15 Feb 2013 00:51:36 +0100	[thread overview]
Message-ID: <1360885896.9475.0.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <CAG6hwVP+D0M-ww8-Joym50WPgL=TUwML3ffjgxT=Mx4q1FHZCA@mail.gmail.com> (sfid-20130214_235252_728553_840C4000)

On Thu, 2013-02-14 at 14:52 -0800, Thomas Pedersen wrote:
> On Thu, Feb 14, 2013 at 2:37 PM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > From: Johannes Berg <johannes.berg@intel.com>
> >
> > Make the ability to leave the plink_state unchanged not use a
> > magic -1 variable that isn't in the enum, but an explicit change
> > flag; reject invalid plink states or actions and move the needed
> > constants for plink actions to the right header file. Also
> > reject plink_state changes for non-mesh interfaces.
> >
> > Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> 
> > diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
> > index 909053a..8e1a03e 100644
> > --- a/net/mac80211/cfg.c
> > +++ b/net/mac80211/cfg.c
> > @@ -1261,7 +1261,9 @@ static int sta_apply_parameters(struct ieee80211_local *local,
> >         if (ieee80211_vif_is_mesh(&sdata->vif)) {
> >  #ifdef CONFIG_MAC80211_MESH
> >                 u32 changed = 0;
> > -               if (sdata->u.mesh.security & IEEE80211_MESH_SEC_SECURED) {
> > +               if (sdata->u.mesh.security & IEEE80211_MESH_SEC_SECURED &&
> > +                   (params->sta_modify_mask &
> > +                                       STATION_PARAM_APPLY_PLINK_STATE)) {
> >                         switch (params->plink_state) {
> >                         case NL80211_PLINK_ESTAB:
> >                                 if (sta->plink_state != NL80211_PLINK_ESTAB)
> > @@ -1292,12 +1294,18 @@ static int sta_apply_parameters(struct ieee80211_local *local,
> >                                 /*  nothing  */
> >                                 break;
> >                         }
> > +               } else if (params->sta_modify_mask &
> > +                                       STATION_PARAM_APPLY_PLINK_STATE) {
> > +                       return -EINVAL;
> 
> It would make sense to disallow setting plink_action if MPM is in userspace.

I'm not sure what you mean?

johannes


  reply	other threads:[~2013-02-14 23:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-14 22:37 [PATCH v3] cfg80211: clean up mesh plink station change API Johannes Berg
2013-02-14 22:52 ` Thomas Pedersen
2013-02-14 23:51   ` Johannes Berg [this message]
2013-02-14 23:59     ` Thomas Pedersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1360885896.9475.0.camel@jlt4.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=j@w1.fi \
    --cc=linux-wireless@vger.kernel.org \
    --cc=thomas@cozybit.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox