const char *driver_params,
enum wpa_p2p_mode p2p_mode)
{
+ static unsigned int next_unique_drv_id = 0;
struct wpa_driver_nl80211_data *drv;
struct i802_bss *bss;
char path[128], buf[200], *pos;
drv->ctx = ctx;
drv->hostapd = !!hostapd;
drv->eapol_sock = -1;
+ drv->unique_drv_id = next_unique_drv_id++;
/*
* There is no driver capability flag for this, so assume it is
static bool nl80211_drv_in_list(struct nl80211_global *global,
- struct wpa_driver_nl80211_data *drv)
+ unsigned int unique_drv_id)
{
struct wpa_driver_nl80211_data *tmp;
dl_list_for_each(tmp, &global->interfaces,
struct wpa_driver_nl80211_data, list) {
- if (drv == tmp)
+ if (tmp->unique_drv_id == unique_drv_id)
return true;
}
dl_list_for_each_safe(drv, tmp, &global->interfaces,
struct wpa_driver_nl80211_data, list) {
+ unsigned int unique_drv_id = drv->unique_drv_id;
+
for (bss = drv->first_bss; bss; bss = bss->next) {
if (wiphy_idx_set)
wiphy_idx = nl80211_get_wiphy_index(bss);
* e.g., due to NL80211_CMD_RADAR_DETECT event,
* so need to stop the loop if that has
* happened. */
- if (!nl80211_drv_in_list(global, drv))
+ if (!nl80211_drv_in_list(global, unique_drv_id))
break;
}
}