]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix ctrl_iface BLACKLIST return value
authorJouni Malinen <j@w1.fi>
Fri, 11 Apr 2014 20:47:46 +0000 (23:47 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 13 Apr 2014 07:26:51 +0000 (10:26 +0300)
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>
wpa_supplicant/ctrl_iface.c

index 01be08985c2bc52f6f500c00b2ae68fcbb6ca711..2f57683979e7ceaa7c47655c86224897f4df91fd 100644 (file)
@@ -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;