From 4a5deb9b9d710e2f930edc968ddae59f0abd2d17 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 3 Nov 2013 13:28:17 +0200 Subject: [PATCH] hostapd: Simplify interface initialization Use hostapd_interface_init2() for all interfaces instead of the previously used different paths for per-interface-config and per-BSS-config cases. This moves the calls to hostapd_driver_init() and hostapd_setup_interface() to happen after all configuration files have been read. Signed-hostap: Jouni Malinen --- hostapd/main.c | 12 ------------ src/ap/hostapd.c | 1 - src/ap/hostapd.h | 1 - 3 files changed, 14 deletions(-) diff --git a/hostapd/main.c b/hostapd/main.c index c9ea970c5..a9163613f 100644 --- a/hostapd/main.c +++ b/hostapd/main.c @@ -261,27 +261,15 @@ hostapd_interface_init(struct hapd_interfaces *interfaces, return NULL; } - if (hostapd_driver_init(iface) || - hostapd_setup_interface(iface)) { - hostapd_interface_deinit_free(iface); - return NULL; - } - - iface->init_done = 1; - return iface; } static int hostapd_interface_init2(struct hostapd_iface *iface) { - if (iface->init_done) - return 0; - if (hostapd_driver_init(iface) || hostapd_setup_interface(iface)) return -1; - iface->init_done = 1; return 0; } diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index faeb56556..0675655b5 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -1581,7 +1581,6 @@ int hostapd_add_iface(struct hapd_interfaces *interfaces, char *buf) interfaces->count--; goto fail; } - hapd_iface->init_done = 1; } else { /* Assign new BSS with bss[0]'s driver info */ hapd = hapd_iface->bss[hapd_iface->num_bss - 1]; diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h index bae4d0b11..ce2516ebb 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h @@ -250,7 +250,6 @@ struct hostapd_iface { char *config_fname; struct hostapd_config *conf; char phy[16]; /* Name of the PHY (radio) */ - int init_done; size_t num_bss; struct hostapd_data **bss;