Linux wireless drivers development
 help / color / mirror / Atom feed
From: Dan Williams <dcbw@redhat.com>
To: leo liang <leoliang9@gmail.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: How the mac80211 handle "\0" essid?
Date: Mon, 24 May 2010 15:24:37 -0700	[thread overview]
Message-ID: <1274739877.19662.39.camel@localhost.localdomain> (raw)
In-Reply-To: <AANLkTilXnak_JDwWcx7ZqwNGEax89_Qj1YcFIH5VtecY@mail.gmail.com>

On Fri, 2010-05-21 at 14:05 -0400, leo liang wrote:
> On Thu, May 20, 2010 at 4:30 PM, Dan Williams <dcbw@redhat.com> wrote:
> > On Thu, 2010-05-20 at 15:40 -0400, leo liang wrote:
> >> Hi,
> >>
> >> Does any one know that if the application send "\0" as essid to
> >> mac80211, how it handle this case?
> >
> > What are you trying to do?  Are you trying to work with a hidden AP, or
> > do something else?
> 
> I want to hide the associated AP name.  Or disassociate and do not let
> the interface connect to any AP.

"I want to hide the associated AP name"

What do you mean by this?  Do you mean make 'iwconfig' or some other
program not report the currently associated AP name?  Or do you mean
something else?

"Or disassociate and do not let..."

For complete disassociation, you don't need to send an empty BSSID when
using nl80211, just send the disassociate command using nl80211 (in
code) or the 'iw' command.  When using WEXT (which is the older
predecessor of nl80211) you need to send a random SSID (ie, 32 random
ascii characters for example) not including \0.  That should cause
devices to disassociate from the AP and not attempt to reconnect to it
until you send a new, valid SSID.

> >
> > An SSID is simply a 32-byte array; the protocol and the stack don't care
> > what's in that array.  So while you can't use command-line tools like
> > 'iwconfig' to send an SSID containing a \0, you can use netlink or
> > wpa_supplicant's nl80211 driver to do so.
> 
> I checked "iwconfig" source code, if you run "iwconfig wlan0 essid
> off", it will set the first char as "\0".

Right, iwconfig is pretty old and does not correctly handle empty
BSSIDs.  Don't depend on the iwconfig behavior.

Dan

> >
> > But in the end, if you're trying to associate with an AP that has an
> > SSID of only '\0', that AP is likely broken or trying to hide it's SSID,
> > and you should be using the real SSID of that AP instead of '\0'.
> >
> > Dan
> >
> >
> >
> --
> 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



  reply	other threads:[~2010-05-24 22:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-20 19:40 How the mac80211 handle "\0" essid? leo liang
2010-05-20 20:30 ` Dan Williams
2010-05-21 18:05   ` leo liang
2010-05-24 22:24     ` Dan Williams [this message]
2010-06-01 13:29       ` leo liang

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=1274739877.19662.39.camel@localhost.localdomain \
    --to=dcbw@redhat.com \
    --cc=leoliang9@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    /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