linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 3/3] mac80211: remove BSS from cfg80211 list when leaving IBSS
Date: Mon, 14 Jun 2010 08:33:27 +0200	[thread overview]
Message-ID: <1276497207.3926.9.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1276496145-5623-4-git-send-email-ext-teemu.3.paasikivi@nokia.com>

On Mon, 2010-06-14 at 09:15 +0300, Teemu Paasikivi wrote:
> Remove BSS from cfg80211 BSS list if we are only member in IBSS when
> leaving it.
> 
> Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
> ---
>  net/mac80211/ibss.c |   33 +++++++++++++++++++++++++++++++++
>  1 files changed, 33 insertions(+), 0 deletions(-)
> 
> diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
> index ff91265..6d5489b 100644
> --- a/net/mac80211/ibss.c
> +++ b/net/mac80211/ibss.c
> @@ -969,6 +969,39 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
>  {
>  	struct sk_buff *skb;
>  
> +	struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;

remove that empty live please

> +	struct ieee80211_local *local = sdata->local;
> +	struct cfg80211_bss *cbss;
> +	struct ieee80211_channel *chan = NULL;
> +	const u8 *bssid = NULL;
> +	u16 capability;
> +	int active_ibss = 0;
> +
> +
> +	active_ibss = ieee80211_sta_active_ibss(sdata);
> +
> +	if (!active_ibss) {
> +		capability = WLAN_CAPABILITY_IBSS;
> +		if (ifibss->privacy)
> +			capability |= WLAN_CAPABILITY_PRIVACY;
> +		if (ifibss->fixed_bssid)
> +			bssid = ifibss->bssid;

Don't we update ifibss->bssid even if it's not fixed?

> +		if (ifibss->fixed_channel)
> +			chan = ifibss->channel;

> +		if (!is_zero_ether_addr(ifibss->bssid))
> +			bssid = ifibss->bssid;

I guess we do, but can it really ever be zeroed? Or does that happen
when we haven't even joined yet? But in that case you'd pass a NULL
bssid into get_bss() which would return a random one ... shouldn't you
rather not do anything in that case? Like making the first condition

if (!active_ibss && !is_zero_ether_addr(ifibss->bssid)) {


and then never worry about the bssid again?

johannes


  reply	other threads:[~2010-06-14  6:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-14  6:15 [PATCH 0/3] mac80211: Add support for configuring ibss basic rates Teemu Paasikivi
2010-06-14  6:15 ` [PATCH 1/3] mac80211: Set basic rates while joining ibss network Teemu Paasikivi
2010-06-14  6:15   ` [PATCH 2/3] mac80211: Set changed basic rates flag Teemu Paasikivi
2010-06-14  6:15     ` [PATCH 3/3] mac80211: remove BSS from cfg80211 list when leaving IBSS Teemu Paasikivi
2010-06-14  6:33       ` Johannes Berg [this message]
2010-06-14  7:16         ` Teemu Paasikivi
2010-06-14  6:30     ` [PATCH 2/3] mac80211: Set changed basic rates flag Johannes Berg
2010-06-14  6:30   ` [PATCH 1/3] mac80211: Set basic rates while joining ibss network Johannes Berg
2010-06-14  6:48     ` Teemu Paasikivi

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=1276497207.3926.9.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=ext-teemu.3.paasikivi@nokia.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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;
as well as URLs for NNTP newsgroup(s).