Fix ctrl_iface BLACKLIST return value

Adding a new entry was returning FAIL on success due to incorrect
assumption of wpa_blacklist_add() returning 0 on success (it returns the
positive blacklist count).

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2014-04-11 23:47:46 +03:00
parent 23fbf45cf5
commit bd8838a387

View file

@ -1861,10 +1861,10 @@ static int wpa_supplicant_ctrl_iface_blacklist(struct wpa_supplicant *wpa_s,
* skipped when processing scan results. * skipped when processing scan results.
*/ */
ret = wpa_blacklist_add(wpa_s, bssid); ret = wpa_blacklist_add(wpa_s, bssid);
if (ret != 0) if (ret < 0)
return -1; return -1;
ret = wpa_blacklist_add(wpa_s, bssid); ret = wpa_blacklist_add(wpa_s, bssid);
if (ret != 0) if (ret < 0)
return -1; return -1;
os_memcpy(buf, "OK\n", 3); os_memcpy(buf, "OK\n", 3);
return 3; return 3;