From bd8838a387ef7b71190ecba360596db129c7f430 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 11 Apr 2014 23:47:46 +0300 Subject: [PATCH] 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 --- wpa_supplicant/ctrl_iface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 01be08985..2f5768397 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -1861,10 +1861,10 @@ static int wpa_supplicant_ctrl_iface_blacklist(struct wpa_supplicant *wpa_s, * skipped when processing scan results. */ ret = wpa_blacklist_add(wpa_s, bssid); - if (ret != 0) + if (ret < 0) return -1; ret = wpa_blacklist_add(wpa_s, bssid); - if (ret != 0) + if (ret < 0) return -1; os_memcpy(buf, "OK\n", 3); return 3;