aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/main.c
diff options
context:
space:
mode:
authorShan Palanisamy <shanp@qca.qualcomm.com>2012-08-25 08:42:30 (GMT)
committerJouni Malinen <j@w1.fi>2012-08-25 10:47:59 (GMT)
commit268a499c08ab44a6577952ecd919222b44c96a1f (patch)
tree2b68aa502440a2dd3f77ad226ff06d0ba08da406 /hostapd/main.c
parent06bb8c62ff5deccfc95192871e3ee61bddc0df26 (diff)
downloadhostap-268a499c08ab44a6577952ecd919222b44c96a1f.zip
hostap-268a499c08ab44a6577952ecd919222b44c96a1f.tar.gz
hostap-268a499c08ab44a6577952ecd919222b44c96a1f.tar.bz2
Allow hostapd to be started without interfaces
If the control interface is enabled, allow hostapd to be started without any configuration files specific on the command line since the interfaces can be added dynamically. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'hostapd/main.c')
-rw-r--r--hostapd/main.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/hostapd/main.c b/hostapd/main.c
index d6c914a..56f0002 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -601,7 +601,7 @@ int main(int argc, char *argv[])
}
}
- if (optind == argc)
+ if (optind == argc && interfaces.global_iface_path == NULL)
usage();
wpa_msg_register_ifname_cb(hostapd_msg_ifname_cb);
@@ -610,11 +610,13 @@ int main(int argc, char *argv[])
wpa_debug_open_file(log_file);
interfaces.count = argc - optind;
- interfaces.iface = os_calloc(interfaces.count,
- sizeof(struct hostapd_iface *));
- if (interfaces.iface == NULL) {
- wpa_printf(MSG_ERROR, "malloc failed");
- return -1;
+ if (interfaces.count) {
+ interfaces.iface = os_calloc(interfaces.count,
+ sizeof(struct hostapd_iface *));
+ if (interfaces.iface == NULL) {
+ wpa_printf(MSG_ERROR, "malloc failed");
+ return -1;
+ }
}
if (hostapd_global_init(&interfaces, entropy_file))