aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2013-04-29 16:42:49 -0700
committerDmitry Shmidt <dimitrysh@google.com>2013-04-29 16:42:49 -0700
commit4b06059785b935dd1f4f09314e4e12c417d2c6a4 (patch)
tree051e9f56fab2cd9d368ed15ff4e97c301d5a569c /hostapd
parent8da800a193fb6f8832218715f82a7b4e2d2ad338 (diff)
downloadandroid_external_wpa_supplicant_8-4b06059785b935dd1f4f09314e4e12c417d2c6a4.tar.gz
android_external_wpa_supplicant_8-4b06059785b935dd1f4f09314e4e12c417d2c6a4.tar.bz2
android_external_wpa_supplicant_8-4b06059785b935dd1f4f09314e4e12c417d2c6a4.zip
Accumulative patch from commit b57b560034f1bb1ad3a3892228940dde97323c0e
b57b560 wpa_supplicant: Default to nl80211 instead of wext ee28f08 hostapd: Add more messages for error paths 61d2ce2 hostapd: Reject configuration file without interface parameter a8a7890 Clear extra_blacklist_count on FLUSH command c646862 WPS ER: Allow UPnP interface to be forced 728d971 Use status code 17 (unable to handle new STA) on max-STA limitation 5e24dc8 Add dup_binstr() to help common binary string tasks 8b44ad7 Use os_zalloc() instead of os_malloc() + os_memset() 2c48211 FT RRB: Validate os_malloc() return value before using it 7ca902b Make vlan_file optional if dynamic_vlan is used bdb112d Add bitfield routines 04382f7 NFC: Add no waiting and no multiple operations options for scripts fe90496 WPS: Fix AP auto configuration on config token generation 28fcfb6 NFC: Increase wpa_cli command buffer size 8f7a6dd WPS NFC: Allow Device Password ID override for selected registrar aaecb69 WPS: Use generic MAC Address attribute builder 9ccd916 P2P: Clean up channel--frequency conversion functions e864c0a Use a common frequency to channel conversion function 02db75b FT: Reset FT flag upon STA deauthentication 7800d45 P2P: Set P2P_DEV_PEER_WAITING_RESPONSE from TX status callback d78d3c6 EAP peer: Add check before calling getSessionId method dd57970 Disable network temporarily on repeated connection failures Change-Id: If8078d5c1ff40ea806e844543cf6f2bf9d24b7ac Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/config_file.c3
-rw-r--r--hostapd/hostapd.conf7
-rw-r--r--hostapd/main.c33
3 files changed, 28 insertions, 15 deletions
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index cd68e3ef..21104d30 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -83,7 +83,7 @@ static int hostapd_config_read_vlan_file(struct hostapd_bss_config *bss,
return -1;
}
- vlan = os_malloc(sizeof(*vlan));
+ vlan = os_zalloc(sizeof(*vlan));
if (vlan == NULL) {
wpa_printf(MSG_ERROR, "Out of memory while reading "
"VLAN interfaces from '%s'", fname);
@@ -91,7 +91,6 @@ static int hostapd_config_read_vlan_file(struct hostapd_bss_config *bss,
return -1;
}
- os_memset(vlan, 0, sizeof(*vlan));
vlan->vlan_id = vlan_id;
os_strlcpy(vlan->ifname, pos, sizeof(vlan->ifname));
if (bss->vlan_tail)
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index d4425866..6a1c500b 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -814,9 +814,8 @@ own_ip_addr=127.0.0.1
# is used for the stations. This information is parsed from following RADIUS
# attributes based on RFC 3580 and RFC 2868: Tunnel-Type (value 13 = VLAN),
# Tunnel-Medium-Type (value 6 = IEEE 802), Tunnel-Private-Group-ID (value
-# VLANID as a string). vlan_file option below must be configured if dynamic
-# VLANs are used. Optionally, the local MAC ACL list (accept_mac_file) can be
-# used to set static client MAC address to VLAN ID mapping.
+# VLANID as a string). Optionally, the local MAC ACL list (accept_mac_file) can
+# be used to set static client MAC address to VLAN ID mapping.
# 0 = disabled (default)
# 1 = option; use default interface if RADIUS server does not include VLAN ID
# 2 = required; reject authentication if RADIUS server does not include VLAN ID
@@ -828,6 +827,8 @@ own_ip_addr=127.0.0.1
# multiple BSSIDs or SSIDs. Each line in this text file is defining a new
# interface and the line must include VLAN ID and interface name separated by
# white space (space or tab).
+# If no entries are provided by this file, the station is statically mapped
+# to <bss-iface>.<vlan-id> interfaces.
#vlan_file=/etc/hostapd.vlan
# Interface where 802.1q tagged packets should appear when a RADIUS server is
diff --git a/hostapd/main.c b/hostapd/main.c
index d2ec1a50..fb82a023 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -194,6 +194,8 @@ static struct hostapd_iface * hostapd_init(const char *config_file)
return hapd_iface;
fail:
+ wpa_printf(MSG_ERROR, "Failed to set up interface with %s",
+ config_file);
if (conf)
hostapd_config_free(conf);
if (hapd_iface) {
@@ -301,13 +303,18 @@ hostapd_interface_init(struct hapd_interfaces *interfaces,
iface->bss[0]->conf->logger_stdout_level--;
}
- if (iface->conf->bss[0].iface[0] != 0 ||
- hostapd_drv_none(iface->bss[0])) {
- if (hostapd_driver_init(iface) ||
- hostapd_setup_interface(iface)) {
- hostapd_interface_deinit_free(iface);
- return NULL;
- }
+ 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);
+ hostapd_interface_deinit_free(iface);
+ return NULL;
+ }
+
+ if (hostapd_driver_init(iface) ||
+ hostapd_setup_interface(iface)) {
+ hostapd_interface_deinit_free(iface);
+ return NULL;
}
return iface;
@@ -647,22 +654,28 @@ int main(int argc, char *argv[])
}
}
- if (hostapd_global_init(&interfaces, entropy_file))
+ if (hostapd_global_init(&interfaces, entropy_file)) {
+ wpa_printf(MSG_ERROR, "Failed to initilize global context");
return -1;
+ }
/* Initialize interfaces */
for (i = 0; i < interfaces.count; i++) {
interfaces.iface[i] = hostapd_interface_init(&interfaces,
argv[optind + i],
debug);
- if (!interfaces.iface[i])
+ if (!interfaces.iface[i]) {
+ wpa_printf(MSG_ERROR, "Failed to initialize interface");
goto out;
+ }
}
hostapd_global_ctrl_iface_init(&interfaces);
- if (hostapd_global_run(&interfaces, daemonize, pid_file))
+ if (hostapd_global_run(&interfaces, daemonize, pid_file)) {
+ wpa_printf(MSG_ERROR, "Failed to start eloop");
goto out;
+ }
ret = 0;