diff --git a/hostapd/config.c b/hostapd/config.c index 3cc2a174c..e62a9c28b 100644 --- a/hostapd/config.c +++ b/hostapd/config.c @@ -26,9 +26,6 @@ #include "config.h" -extern struct wpa_driver_ops *wpa_drivers[]; - - static void hostapd_config_free_vlan(struct hostapd_bss_config *bss) { struct hostapd_vlan *vlan, *prev; @@ -115,15 +112,6 @@ struct hostapd_config * hostapd_config_defaults(void) 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)); if (bss->radius == NULL) { os_free(conf); diff --git a/hostapd/config_file.c b/hostapd/config_file.c index 0554f1275..c0a59dbd3 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -1148,6 +1148,15 @@ struct hostapd_config * hostapd_config_read(const char *fname) fclose(f); 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; while (fgets(buf, sizeof(buf), f)) {