bss->max_listen_interval = 65535;
#ifdef CONFIG_IEEE80211W
- bss->assoc_ping_timeout = 1000;
- bss->assoc_ping_attempts = 3;
+ bss->assoc_sa_query_max_timeout = 1000;
+ bss->assoc_sa_query_retry_timeout = 201;
#endif /* CONFIG_IEEE80211W */
#ifdef EAP_FAST
/* both anonymous and authenticated provisioning */
os_memcpy(psk->addr, addr, ETH_ALEN);
pos = buf + 17;
- if (pos == '\0') {
+ if (*pos == '\0') {
printf("No PSK on line %d in '%s'\n", line, fname);
os_free(psk);
ret = -1;
return -1;
start = buf;
- while (start != '\0') {
+ while (*start != '\0') {
while (*start == ' ' || *start == '\t')
start++;
if (*start == '\0')
return -1;
start = buf;
- while (start != '\0') {
+ while (*start != '\0') {
while (*start == ' ' || *start == '\t')
start++;
if (*start == '\0')
}
#endif /* CONFIG_IEEE80211R */
+#ifdef CONFIG_IEEE80211N
+ if (conf->ieee80211n && bss->wpa &&
+ !(bss->wpa_pairwise & WPA_CIPHER_CCMP) &&
+ !(bss->rsn_pairwise & WPA_CIPHER_CCMP)) {
+ printf("HT (IEEE 802.11n) with WPA/WPA2 requires CCMP to be "
+ "enabled\n");
+ return -1;
+ }
+#endif /* CONFIG_IEEE80211N */
+
return 0;
}
#endif /* CONFIG_IEEE80211N */
+/**
+ * hostapd_config_read - Read and parse a configuration file
+ * @fname: Configuration file name (including path, if needed)
+ * Returns: Allocated configuration data structure
+ */
struct hostapd_config * hostapd_config_read(const char *fname)
{
struct hostapd_config *conf;
#ifdef CONFIG_IEEE80211W
} else if (os_strcmp(buf, "ieee80211w") == 0) {
bss->ieee80211w = atoi(pos);
- } else if (os_strcmp(buf, "assoc_ping_timeout") == 0) {
- bss->assoc_ping_timeout = atoi(pos);
- if (bss->assoc_ping_timeout == 0) {
- printf("Line %d: invalid assoc_ping_timeout\n",
- line);
+ } else if (os_strcmp(buf, "assoc_sa_query_max_timeout") == 0) {
+ bss->assoc_sa_query_max_timeout = atoi(pos);
+ if (bss->assoc_sa_query_max_timeout == 0) {
+ printf("Line %d: invalid "
+ "assoc_sa_query_max_timeout\n",
+ line);
errors++;
}
- } else if (os_strcmp(buf, "assoc_ping_attempts") == 0) {
- bss->assoc_ping_timeout = atoi(pos);
- if (bss->assoc_ping_timeout == 0) {
- printf("Line %d: invalid assoc_ping_attempts "
- "(valid range: 1..255)\n",
+ } else if (os_strcmp(buf, "assoc_sa_query_retry_timeout") == 0)
+ {
+ bss->assoc_sa_query_retry_timeout = atoi(pos);
+ if (bss->assoc_sa_query_retry_timeout == 0) {
+ printf("Line %d: invalid "
+ "assoc_sa_query_retry_timeout\n",
line);
errors++;
}
} else if (os_strcmp(buf, "wps_pin_requests") == 0) {
bss->wps_pin_requests = os_strdup(pos);
} else if (os_strcmp(buf, "device_name") == 0) {
+ if (os_strlen(pos) > 32) {
+ printf("Line %d: Too long device_name\n",
+ line);
+ errors++;
+ }
bss->device_name = os_strdup(pos);
} else if (os_strcmp(buf, "manufacturer") == 0) {
+ if (os_strlen(pos) > 64) {
+ printf("Line %d: Too long manufacturer\n",
+ line);
+ errors++;
+ }
bss->manufacturer = os_strdup(pos);
} else if (os_strcmp(buf, "model_name") == 0) {
+ if (os_strlen(pos) > 32) {
+ printf("Line %d: Too long model_name\n",
+ line);
+ errors++;
+ }
bss->model_name = os_strdup(pos);
} else if (os_strcmp(buf, "model_number") == 0) {
+ if (os_strlen(pos) > 32) {
+ printf("Line %d: Too long model_number\n",
+ line);
+ errors++;
+ }
bss->model_number = os_strdup(pos);
} else if (os_strcmp(buf, "serial_number") == 0) {
+ if (os_strlen(pos) > 32) {
+ printf("Line %d: Too long serial_number\n",
+ line);
+ errors++;
+ }
bss->serial_number = os_strdup(pos);
} else if (os_strcmp(buf, "device_type") == 0) {
bss->device_type = os_strdup(pos);
}
+/**
+ * hostapd_config_free - Free hostapd configuration
+ * @conf: Configuration data from hostapd_config_read().
+ */
void hostapd_config_free(struct hostapd_config *conf)
{
size_t i;
}
-/* Perform a binary search for given MAC address from a pre-sorted list.
- * Returns 1 if address is in the list or 0 if not. */
+/**
+ * hostapd_maclist_found - Find a MAC address from a list
+ * @list: MAC address list
+ * @num_entries: Number of addresses in the list
+ * @addr: Address to search for
+ * @vlan_id: Buffer for returning VLAN ID or %NULL if not needed
+ * Returns: 1 if address is in the list or 0 if not.
+ *
+ * Perform a binary search for given MAC address from a pre-sorted list.
+ */
int hostapd_maclist_found(struct mac_acl_entry *list, int num_entries,
const u8 *addr, int *vlan_id)
{