Move wpa_drivers dependency into config_file.c
authorJouni Malinen <j@w1.fi>
Thu, 24 Dec 2009 20:50:17 +0000 (22:50 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 24 Dec 2009 20:50:17 +0000 (22:50 +0200)
This cleans up config.o from driver wrapper dependencies.

hostapd/config.c
hostapd/config_file.c

index 3cc2a17..e62a9c2 100644 (file)
@@ -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);
index 0554f12..c0a59db 100644 (file)
@@ -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)) {