essid_len in SIOCSIWESSID
Jouni Malinen
jkmaline
Sun Aug 29 11:53:35 PDT 2004
On Sun, Aug 29, 2004 at 04:44:48PM +0100, Pedro Ramalhais wrote:
> I've noticed that wpa_suplpicant is causing the essid to be set
> incorrectly. wpa_supplicant is setting
>
> iwr.u.essid.length = ssid_len
>
> but wireless tools is setting
>
> wrq.u.essid.length = strlen(essid) + 1
>
> in SIOCSIWESSID.
>
> So, which one is correct?
SSID is allowed to contain ASCII-0 ("nul termination" in C strings) and
strlen() would not give correct length for such a string. I believe SSID
should be treated as a binary data, not a string. Consequently,
strlen()+1 or real SSID length + 1 do not sound correct.
However, this may be a bit problematic in real world with the current
implementations of wireless extensions.. Host AP driver supports both
strlen()+1 and SSID as binary data with correct length; though, it does
not support ASCII-0.. If I remember correctly, there were some issues in
setting 32-byte longth SSIDs with some versions of iwconfig. This was
somehow related to this len or len+1 question.
--
Jouni Malinen PGP id EFC895FA
More information about the Hostap
mailing list