Move hostapd-to-driver flag mapping to be within ap_drv_ops.c
[libeap.git] / hostapd / config_file.c
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)) {