fixing the ap_scan and hidden SSID mess
Quoted 3 lines · Dan Williams
Hidden SSID is a mess right now. Here's why, and here's a proposal for fixing it.
If you want my participation, it's usually wise to cc me.
Quoted 2 lines
The problem is that there isn't a nice, generic capabilities field in WEXT. So we have to abuse an existing one, and I picked
enc_capa.
Please don't do that. It's fairly trivial to add a new field
in iwrange. And it's not like the sky will fall down if we add a field in iwrange. If you want to do it, please do it right.
Note that there is one gotcha because of the state of
userspace, so if you want I can produce a kernel patch that will work properly, and I'll add the usespace support for it as well.
Quoted 1 line
+#define
IW_ENC_CAPA_SPECIFIC_SSID_SCAN0x00000010
That won't work. You have a tri-state, and with only a single
bit you can encode only two state. You basically have :
o driver that support ap_scan=1
o driver that do not support ap_scan=1
o driver that have not been updated or reside in old kernels So, at the minimum, you'd want :
-------------------------------------
+#define IW_ENC_CAPA_SPECIFIC_SSID_SCAN 0x00000010
+#define IW_ENC_CAPA_ANY_SSID_SCAN 0x00000020
-------------------------------------
Quoted 3 lines
However, userspace is f*cked because it can't figure out which one to use, and trying both is not an option because you get unacceptable latency for the user when trying to associate.
Another option would be for SIOCSIWSCAN to fail if a specific
SSID is set and it does not support it, instead of just ignoring it.
Regards,
Jean
Quoted 6 lines · Jean Tourrilhes
Quoted 3 lines · Dan Williams
Hidden SSID is a mess right now. Here's why, and here's a proposal for fixing it.
If you want my participation, it's usually wise to cc me.
Unintentional omission, sorry... I was thinking of it more as a driver issue but you're right.
Quoted 6 lines
Quoted 2 lines
The problem is that there isn't a nice, generic capabilities field in WEXT. So we have to abuse an existing one, and I picked
enc_capa.Please don't do that. It's fairly trivial to add a new field
in iwrange. And it's not like the sky will fall down if we add a field in iwrange. If you want to do it, please do it right.
Well, the problem I had with this is that it's less likely to get backported because it potentially breaks binary compatibility for distros. There are 3 options here:
1) overload enc_capa
2) add a field and start doing comparisons of the size of the iw_range structure to figure out what is available and what's not
3) Bump the WEXT version
#3 is a non-starter because it is a much larger, more invasive change and requires more breakage of ABI and such.
I guess #2 is acceptable.
Quoted 3 lines
Note that there is one gotcha because of the state of
userspace, so if you want I can produce a kernel patch that will work properly, and I'll add the usespace support for it as well.
Could you describe that more?
Quoted 7 lines
Quoted 1 line
+#define
IW_ENC_CAPA_SPECIFIC_SSID_SCAN0x00000010That won't work. You have a tri-state, and with only a single
bit you can encode only two state. You basically have :
o driver that support ap_scan=1
o driver that do not support ap_scan=1
o driver that have not been updated or reside in old kernels
Well, to be fair, the patch posted handles this perfectly well, because older kernels with drivers that don't have the capability just dont' advertise it. Therefore everything works fine.
Review
Quoted 5 lines
So, at the minimum, you'd want :
-------------------------------------(quoted diff) +2
-1+#define IW_ENC_CAPA_SPECIFIC_SSID_SCAN 0x00000010 +#define IW_ENC_CAPA_ANY_SSID_SCAN 0x00000020 -------------------------------------
I'm not sure why we'd want ANY_SSID_SCAN? It's already assumed that all drivers support scanning. Drivers that don't support scanning and are already in the tree have so few users and are so old that we just don't care. New drivers will get a HUGE NAK if they don't have scanning support, so I don't really see this as necessary.
Quoted 6 lines
Quoted 3 lines
However, userspace is f*cked because it can't figure out which one to use, and trying both is not an option because you get unacceptable latency for the user when trying to associate.
Another option would be for SIOCSIWSCAN to fail if a specific
SSID is set and it does not support it, instead of just ignoring it.
Again, that won't work because it requires changing _all_ drivers. We need to fix this by ensuring that the change only affects those drivers that support the capability, not requiring drivers that dont' have it to change. Extending range would work here.
Dan
Quoted 14 lines · Dan Williams
Quoted 7 lines
Quoted 3 lines
The problem is that there isn't a nice, generic capabilities field in WEXT. So we have to abuse an existing one, and I picked
enc_capa.Please don't do that. It's fairly trivial to add a new field
in iwrange. And it's not like the sky will fall down if we add a field in iwrange. If you want to do it, please do it right.Well, the problem I had with this is that it's less likely to get backported because it potentially breaks binary compatibility for distros. There are 3 options here:
1) overload
enc_capa
Quoted 7 lines
2) add a field and start doing comparisons of the size of the
iw_rangestructure to figure out what is available and what's not3) Bump the WEXT version
#3 is a non-starter because it is a much larger, more invasive change and requires more breakage of ABI and such.
Hu ? Please tell me what will break. We can bump the WEXT
version pretty much any time we want, no userspace will fail. THe worse you may see is an anoying warning message.
Quoted 1 line
I guess #2 is acceptable.
Option 4 : use two flags (as described below), that way you
know if iwrange implement the feature or not.
Quoted 5 lines
Quoted 3 lines
Note that there is one gotcha because of the state of
userspace, so if you want I can produce a kernel patch that will work properly, and I'll add the usespace support for it as well.Could you describe that more?
The iwrange in userspace has a few more stuff defined, so you
need to make sure to include padding to not add your field on an already existing field. Check the wireless.21.h file.
Note that if you sign the usual suspects on that change, I'll
do the patch for you.
Quoted 10 lines
Quoted 5 lines
That won't work. You have a tri-state, and with only a single
bit you can encode only two state. You basically have :
o driver that support ap_scan=1
o driver that do not support ap_scan=1
o driver that have not been updated or reside in old kernelsWell, to be fair, the patch posted handles this perfectly well, because older kernels with drivers that don't have the capability just dont' advertise it. Therefore everything works fine.
Quoted 7 lines
Review
Quoted 5 lines
So, at the minimum, you'd want :
-------------------------------------(quoted diff) +2
-1+#define IW_ENC_CAPA_SPECIFIC_SSID_SCAN 0x00000010 +#define IW_ENC_CAPA_ANY_SSID_SCAN 0x00000020 -------------------------------------I'm not sure why we'd want
ANY_SSID_SCAN?
To distinguish driver that have not been updated or driver in
order kernel from drivers that do not support ap_scan=1. You may want to do things slightly differently between those two.
It just act as : yes this driver has been audited and fixed to
export proper scanning capability support.
Quoted 4 lines
Quoted 2 lines
Another option would be for SIOCSIWSCAN to fail if a specific
SSID is set and it does not support it, instead of just ignoring it.Again, that won't work because it requires changing _all_ drivers.
And ? In some case it's preferable to fix all driver rather
than to mess us the API. In many instances we fix all drivers.
Quoted 6 lines
We
need to fix this by ensuring that the change only affects those drivers that support the capability, not requiring drivers that dont' have it to change. Extending range would work here.Dan
Have fun,
Jean
Quoted 18 lines · Jean Tourrilhes
Quoted 17 lines · Dan Williams
Quoted 7 lines
Quoted 3 lines
The problem is that there isn't a nice, generic capabilities field in WEXT. So we have to abuse an existing one, and I picked
enc_capa.Please don't do that. It's fairly trivial to add a new field
in iwrange. And it's not like the sky will fall down if we add a field in iwrange. If you want to do it, please do it right.Well, the problem I had with this is that it's less likely to get backported because it potentially breaks binary compatibility for distros. There are 3 options here:
1) overload
enc_capa2) add a field and start doing comparisons of the size of the
iw_rangestructure to figure out what is available and what's not
Quoted 8 lines
Quoted 4 lines
3) Bump the WEXT version
#3 is a non-starter because it is a much larger, more invasive change and requires more breakage of ABI and such.
Hu ? Please tell me what will break. We can bump the WEXT
version pretty much any time we want, no userspace will fail. THe worse you may see is an anoying warning message.
It's a problem for backporting this fix to older kernels that are not 2.6.25. If a WEXT version bump is required, then you have two options to backport this to drivers:
1) take the entire driver as-is. This usually won't work because many drivers are in a lot of flux, especially the softmac ones with their interdependencies on the stack.
2) Backport the SCAN_CAPA stuff only and bump the wext version. This may mean that the driver says it supports WEXT 24 for example, but doesn't actually have all the features that the current kernel driver that advertises v24 has. Another dead end.
Quoted 35 lines
Quoted 1 line
I guess #2 is acceptable.
Option 4 : use two flags (as described below), that way you
know if iwrange implement the feature or not.Quoted 5 lines
Quoted 3 lines
Note that there is one gotcha because of the state of
userspace, so if you want I can produce a kernel patch that will work properly, and I'll add the usespace support for it as well.Could you describe that more?
The iwrange in userspace has a few more stuff defined, so you
need to make sure to include padding to not add your field on an already existing field. Check thewireless.21.hfile.
Note that if you sign the usual suspects on that change, I'll
do the patch for you.Quoted 10 lines
Quoted 5 lines
That won't work. You have a tri-state, and with only a single
bit you can encode only two state. You basically have :
o driver that support ap_scan=1
o driver that do not support ap_scan=1
o driver that have not been updated or reside in old kernelsWell, to be fair, the patch posted handles this perfectly well, because older kernels with drivers that don't have the capability just dont' advertise it. Therefore everything works fine.
Quoted 7 lines
Review
Quoted 5 lines
So, at the minimum, you'd want :
-------------------------------------(quoted diff) +2
-1+#define IW_ENC_CAPA_SPECIFIC_SSID_SCAN 0x00000010 +#define IW_ENC_CAPA_ANY_SSID_SCAN 0x00000020 -------------------------------------I'm not sure why we'd want
ANY_SSID_SCAN?
Quoted 5 lines
To distinguish driver that have not been updated or driver in
order kernel from drivers that do not support ap_scan=1. You may want to do things slightly differently between those two.
It just act as : yes this driver has been audited and fixed to
export proper scanning capability support.
So is the ANY_SSID_SCAN thing different from just calling SIOCSIWSCAN _without_ any options? I was under the impression that just calling SIWSCAN would scan for all SSIDs.
I've actually thought about your proposal, and decided that you're right. I'll post another patch for more comments.
dan
Quoted 3 lines · Dan Williams
It's a problem for backporting this fix to older kernels that are not 2.6.25.
I think backporting would be a non starter, only bug fixes are
suppossed to be backported. For out-of-tree driver, a #ifdef will do the trick trivially.
Quoted 3 lines
So is the
ANY_SSID_SCANthing different from just calling SIOCSIWSCAN _without_ any options? I was under the impression that just calling SIWSCAN would scan for all SSIDs.
You are right. Actually, if you stuff a empty essid in
SIOCSIWSCAN, I doubt it would work.
The purpose of the flag is different : identify audited from
non audited drivers.
Quoted 4 lines
I've actually thought about your proposal, and decided that you're right. I'll post another patch for more comments.
dan
Regards,
Jean