Linux wireless drivers development
 help / color / mirror / Atom feed
* How the mac80211 handle "\0" essid?
@ 2010-05-20 19:40 leo liang
  2010-05-20 20:30 ` Dan Williams
  0 siblings, 1 reply; 5+ messages in thread
From: leo liang @ 2010-05-20 19:40 UTC (permalink / raw)
  To: linux-wireless

Hi,

Does any one know that if the application send "\0" as essid to
mac80211, how it handle this case?

I am studying mac80211 code, but I don't get this answer yet. Could
some give me the answer or a tip?

Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How the mac80211 handle "\0" essid?
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Williams @ 2010-05-20 20:30 UTC (permalink / raw)
  To: leo liang; +Cc: linux-wireless

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?

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.

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How the mac80211 handle "\0" essid?
  2010-05-20 20:30 ` Dan Williams
@ 2010-05-21 18:05   ` leo liang
  2010-05-24 22:24     ` Dan Williams
  0 siblings, 1 reply; 5+ messages in thread
From: leo liang @ 2010-05-21 18:05 UTC (permalink / raw)
  To: Dan Williams; +Cc: linux-wireless

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.
>
> 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".

>
> 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
>
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How the mac80211 handle "\0" essid?
  2010-05-21 18:05   ` leo liang
@ 2010-05-24 22:24     ` Dan Williams
  2010-06-01 13:29       ` leo liang
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Williams @ 2010-05-24 22:24 UTC (permalink / raw)
  To: leo liang; +Cc: linux-wireless

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How the mac80211 handle "\0" essid?
  2010-05-24 22:24     ` Dan Williams
@ 2010-06-01 13:29       ` leo liang
  0 siblings, 0 replies; 5+ messages in thread
From: leo liang @ 2010-06-01 13:29 UTC (permalink / raw)
  To: Dan Williams; +Cc: linux-wireless

Thank you for the answer.

On Mon, May 24, 2010 at 6:24 PM, Dan Williams <dcbw@redhat.com> wrote:
> 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
>
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-06-01 13:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2010-06-01 13:29       ` leo liang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox