WPS: Fix return value when context is not valid
authorPetar Koretic <petar.koretic@sartura.hr>
Wed, 14 May 2014 13:51:04 +0000 (13:51 +0000)
committerJouni Malinen <j@w1.fi>
Thu, 15 May 2014 21:58:48 +0000 (00:58 +0300)
commitc78c6b73fa318bb1ecd39b65a1e641f63eb4426c
tree1f0b0852a35c3cdaa606092145b32fb9409356aa
parent4ef7053119b4c7c2a10b40c58c52ddf672aef9c3
WPS: Fix return value when context is not valid

If WPS isn't enabled, hostapd_cli returns 'OK' even though WPS doesn't
get activated because WPS context is not valid:

$ hostapd_cli wps_pbc
Selected interface 'wlan0'
OK

$ hostapd_cli wps_cancel
Selected interface 'wlan0'
OK

Fix this by returning appropriate error when WPS fails to activate:

$ hostapd_cli wps_pbc
Selected interface 'wlan0'
FAIL

$ hostapd_cli wps_cancel
Selected interface 'wlan0'
FAIL

Signed-off-by: Petar Koretic <petar.koretic@sartura.hr>
CC: Luka Perkov <luka.perkov@sartura.hr>
src/ap/wps_hostapd.c