Move wpa_drivers dependency into config_file.c

This cleans up config.o from driver wrapper dependencies.
This commit is contained in:
Jouni Malinen 2009-12-24 22:50:17 +02:00
parent a3d4fafa41
commit d3b86aed73
2 changed files with 9 additions and 12 deletions

View file

@ -26,9 +26,6 @@
#include "config.h" #include "config.h"
extern struct wpa_driver_ops *wpa_drivers[];
static void hostapd_config_free_vlan(struct hostapd_bss_config *bss) static void hostapd_config_free_vlan(struct hostapd_bss_config *bss)
{ {
struct hostapd_vlan *vlan, *prev; struct hostapd_vlan *vlan, *prev;
@ -115,15 +112,6 @@ struct hostapd_config * hostapd_config_defaults(void)
return NULL; return NULL;
} }
/* set default driver based on configuration */
conf->driver = wpa_drivers[0];
if (conf->driver == NULL) {
wpa_printf(MSG_ERROR, "No driver wrappers registered!");
os_free(conf);
os_free(bss);
return NULL;
}
bss->radius = os_zalloc(sizeof(*bss->radius)); bss->radius = os_zalloc(sizeof(*bss->radius));
if (bss->radius == NULL) { if (bss->radius == NULL) {
os_free(conf); os_free(conf);

View file

@ -1148,6 +1148,15 @@ struct hostapd_config * hostapd_config_read(const char *fname)
fclose(f); fclose(f);
return NULL; return NULL;
} }
/* set default driver based on configuration */
conf->driver = wpa_drivers[0];
if (conf->driver == NULL) {
wpa_printf(MSG_ERROR, "No driver wrappers registered!");
hostapd_config_free(conf);
return NULL;
}
bss = conf->last_bss = conf->bss; bss = conf->last_bss = conf->bss;
while (fgets(buf, sizeof(buf), f)) { while (fgets(buf, sizeof(buf), f)) {