Disable AP PIN on all interfaces controlled by the same process
[libeap.git] / wpa_supplicant / bss.c
index d5bb040..dc978af 100644 (file)
 #include "common/ieee802_11_defs.h"
 #include "drivers/driver.h"
 #include "wpa_supplicant_i.h"
+#include "config.h"
 #include "notify.h"
 #include "scan.h"
 #include "bss.h"
 
 
-#ifndef WPA_BSS_MAX_COUNT
-#define WPA_BSS_MAX_COUNT 200
-#endif /* WPA_BSS_MAX_COUNT */
-
 /**
  * WPA_BSS_EXPIRATION_PERIOD - Period of expiration run in seconds
  */
@@ -139,7 +136,7 @@ static void wpa_bss_add(struct wpa_supplicant *wpa_s,
        wpa_printf(MSG_DEBUG, "BSS: Add new id %u BSSID " MACSTR " SSID '%s'",
                   bss->id, MAC2STR(bss->bssid), wpa_ssid_txt(ssid, ssid_len));
        wpas_notify_bss_added(wpa_s, bss->bssid, bss->id);
-       if (wpa_s->num_bss > WPA_BSS_MAX_COUNT) {
+       if (wpa_s->num_bss > wpa_s->conf->bss_max_count) {
                /* Remove the oldest entry */
                wpa_bss_remove(wpa_s, dl_list_first(&wpa_s->bss,
                                                    struct wpa_bss, list));
@@ -328,7 +325,7 @@ void wpa_bss_update_start(struct wpa_supplicant *wpa_s)
 void wpa_bss_update_scan_res(struct wpa_supplicant *wpa_s,
                             struct wpa_scan_res *res)
 {
-       const u8 *ssid;
+       const u8 *ssid, *p2p;
        struct wpa_bss *bss;
 
        ssid = wpa_scan_get_ie(res, WLAN_EID_SSID);
@@ -343,6 +340,11 @@ void wpa_bss_update_scan_res(struct wpa_supplicant *wpa_s,
                return;
        }
 
+       p2p = wpa_scan_get_vendor_ie(res, P2P_IE_VENDOR_TYPE);
+       if (p2p && ssid[1] == P2P_WILDCARD_SSID_LEN &&
+           os_memcmp(ssid + 2, P2P_WILDCARD_SSID, P2P_WILDCARD_SSID_LEN) == 0)
+               return; /* Skip P2P listen discovery results here */
+
        /* TODO: add option for ignoring BSSes we are not interested in
         * (to save memory) */
        bss = wpa_bss_get(wpa_s, res->bssid, ssid + 2, ssid[1]);