wpa_cli quirks?

Jouni Malinen j
Thu Mar 13 03:02:57 PDT 2008


On Wed, Mar 01, 2006 at 09:40:36PM +1000, Kel Modderman wrote:

> I'd like to query the handling of wpa_cli commands executed as 
> arguments, rather than  from within the wpa_cli console. Are they 
> handled differently as in the following example?

No, they are processed in the exact same way. However, as pointed out in
the later messages in this thread, the shell can make this bit more
complex due to quotation marks being processed at that level.

> root at KELSLAP:/home/kel# wpa_cli -i eth1 set_network 1 ssid "kelnet"
> FAIL

With most shells, this would end up trying to send the SSID without
quotation marks which wpa_supplicant will then try to interpret as a hex
string (all strings can be configured either as quoted ASCII text or
hex dump without quotation marks).


> Also, are the valid values of ap_scan only 0,1 & 2?

Yes.

>  > ap_scan 3
> FAIL
>  > ap_scan foo
> OK
> 
> Shouldn't it reject the garbage value of "foo"?

Well, yes, it should. I did not bother adding extra validation for the
string being an integer and this is just "interpreted" with atoi() and
atoi() returns 0 when it doesn't find initial digits from the string..
Taken into account that there are only three valid options here, this
could be replaced with couple of if statement or a switch statement..

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list