On Mon, Jan 30, 2006 at 10:13:16AM -0800, Jean Tourrilhes wrote:
> On Fri, Jan 27, 2006 at 05:01:44PM -0800, Jouni Malinen wrote:

>       It is spelled very clearly on my web site :
> ---------------------------------------------------------------
> # The HostAP driver is the reference implementation of Wireless
> Extensions for 802.11b devices, and is the reference implementation
> for iwpriv functionality.
> 
> # The Aironet driver (version 1.4 and later from Ben) is an alternate
> reference implementation of Wireless Extensions for 802.11b
> devices. It implements fully WE-14 (Wireless Scanning and Wireless
> Events), and is different than HostAP.

Unfortunately, this may cause some unclarity for this particular case. I
seem to have used SSID length in Host AP driver (even though I now
understand that it should probably have been len+1) and Aironet driver
is using len+1..

>       The problem with documentations is that they are never in sync
> with the implementation, so potentially misleading. That's why we have
> reference implementations.

And the reference implementations are not in sync in this particular
case..

> > My current assumption is that both ioctls were expected to to include
> > extra nul termination in SSID (even though I don't see much point with
> > this) and the data field for SSID is expected to have that nul
> > termination. In other words, if a user space program uses SSID as a
> > octet string (like wpa_supplicant is doing), setting SSID would need to
> > use len+1 and extra '\0' added to the end of SSID data (e.g., by
> > clearing the structure before copying SSID). In case of getting the
> > SSID, kernel driver would do similar changes and len-1 would be used in
> > user space.
> 
>       Yep.

After writing that paragraph (and after having sent that email), I
looked at what Host AP driver was doing, and it was not following this..
In other words, Host AP driver has inconsistent definition of SSID
length in SIOCGIWESSID (len) and SIOCSIWESSID (len+1). Or well, I think
it accept both len and len+1 in SIOCSIWESSID, but wpa_supplicant is now
using len+1.

> > I would have preferred to see these ioctls use correct length and no
> > expectation on the SSID data being a printable string. However, if the
> > user space programs were to do this for SIOCSIWESSID, some drivers would
> > configure incorrect SSID (the last octet missing).
> 
>       We can make this change, it you desire.

At this point, I don't really see any need to change this in the API.
However, I would like to see us having clear definition on what is the
correct behavior so that the drivers can be fixed to do the same thing.
I have nothing against changing Host AP driver to return len+1 in
SIOCSIWESSID, if that doesn't break user space programs. Though, it
sounds like it actually would have broken older versions (well, all
released stable versions) which makes this change a bit unfortunate.
Anyway, if I have used the API incorrectly, it could finally be the time
to fix that after this many years ;-).

-- 
Jouni Malinen                                            PGP id EFC895FA
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to