aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/main.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2013-10-29 14:23:23 (GMT)
committerJouni Malinen <j@w1.fi>2013-10-29 14:58:21 (GMT)
commitebd79f07c47b02b71c0ac7744a6a94a2bae92fcf (patch)
treea8cb1715c26bdba2062a8e924b7ae513f041e716 /hostapd/main.c
parenta781e211f9cc45ad369d742a204d41c8a98e61d0 (diff)
downloadhostap-ebd79f07c47b02b71c0ac7744a6a94a2bae92fcf.zip
hostap-ebd79f07c47b02b71c0ac7744a6a94a2bae92fcf.tar.gz
hostap-ebd79f07c47b02b71c0ac7744a6a94a2bae92fcf.tar.bz2
hostapd: Make hostapd_config::bss array of pointers
This makes it more convenient to move BSS configuration entries between struct hostapd_config instances to clean up per-BSS configuration file design. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'hostapd/main.c')
-rw-r--r--hostapd/main.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/hostapd/main.c b/hostapd/main.c
index 6a67347..ab75b5f 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -185,7 +185,7 @@ static struct hostapd_iface * hostapd_init(const char *config_file)
for (i = 0; i < conf->num_bss; i++) {
hapd = hapd_iface->bss[i] =
hostapd_alloc_bss_data(hapd_iface, conf,
- &conf->bss[i]);
+ conf->bss[i]);
if (hapd == NULL)
goto fail;
hapd->msg_ctx = hapd;
@@ -313,7 +313,7 @@ hostapd_interface_init(struct hapd_interfaces *interfaces,
iface->bss[0]->conf->logger_stdout_level--;
}
- if (iface->conf->bss[0].iface[0] == '\0' &&
+ if (iface->conf->bss[0]->iface[0] == '\0' &&
!hostapd_drv_none(iface->bss[0])) {
wpa_printf(MSG_ERROR, "Interface name not specified in %s",
config_fname);
@@ -526,8 +526,9 @@ static void usage(void)
static const char * hostapd_msg_ifname_cb(void *ctx)
{
struct hostapd_data *hapd = ctx;
- if (hapd && hapd->iconf && hapd->iconf->bss)
- return hapd->iconf->bss->iface;
+ if (hapd && hapd->iconf && hapd->iconf->bss &&
+ hapd->iconf->num_bss > 0 && hapd->iconf->bss[0])
+ return hapd->iconf->bss[0]->iface;
return NULL;
}