Fix init2() driver_ops to get the correct global driver context

Need to provide the private driver context, not the wpa_supplicant
global context, in init2() call.
This commit is contained in:
Jouni Malinen 2009-11-28 18:11:16 +02:00 committed by Jouni Malinen
parent ed45947e9b
commit 8a5ab9f5e5
3 changed files with 5 additions and 1 deletions

View file

@ -22,7 +22,8 @@ static inline void * wpa_drv_init(struct wpa_supplicant *wpa_s,
const char *ifname) const char *ifname)
{ {
if (wpa_s->driver->init2) if (wpa_s->driver->init2)
return wpa_s->driver->init2(wpa_s, ifname, wpa_s->global); return wpa_s->driver->init2(wpa_s, ifname,
wpa_s->global_drv_priv);
if (wpa_s->driver->init) { if (wpa_s->driver->init) {
return wpa_s->driver->init(wpa_s, ifname); return wpa_s->driver->init(wpa_s, ifname);
} }

View file

@ -1704,6 +1704,7 @@ static int wpa_supplicant_set_driver(struct wpa_supplicant *wpa_s,
if (name == NULL) { if (name == NULL) {
/* default to first driver in the list */ /* default to first driver in the list */
wpa_s->driver = wpa_drivers[0]; wpa_s->driver = wpa_drivers[0];
wpa_s->global_drv_priv = wpa_s->global->drv_priv[0];
return 0; return 0;
} }
@ -1717,6 +1718,7 @@ static int wpa_supplicant_set_driver(struct wpa_supplicant *wpa_s,
os_strncmp(name, wpa_drivers[i]->name, len) == os_strncmp(name, wpa_drivers[i]->name, len) ==
0) { 0) {
wpa_s->driver = wpa_drivers[i]; wpa_s->driver = wpa_drivers[i];
wpa_s->global_drv_priv = wpa_s->global->drv_priv[i];
return 0; return 0;
} }
} }

View file

@ -333,6 +333,7 @@ struct wpa_supplicant {
int mgmt_group_cipher; int mgmt_group_cipher;
void *drv_priv; /* private data used by driver_ops */ void *drv_priv; /* private data used by driver_ops */
void *global_drv_priv;
struct wpa_ssid *prev_scan_ssid; /* previously scanned SSID; struct wpa_ssid *prev_scan_ssid; /* previously scanned SSID;
* NULL = not yet initialized (start * NULL = not yet initialized (start