Example #1
0
void hostapd_deinit_wpa(struct hostapd_data *hapd)
{
	rsn_preauth_iface_deinit(hapd);
	if (hapd->wpa_auth) {
		wpa_deinit(hapd->wpa_auth);
		hapd->wpa_auth = NULL;

		if (hostapd_set_privacy(hapd, 0)) {
			wpa_printf(MSG_DEBUG, "Could not disable "
				   "PrivacyInvoked for interface %s",
				   hapd->conf->iface);
		}

		if (hostapd_set_generic_elem(hapd, (u8 *) "", 0)) {
			wpa_printf(MSG_DEBUG, "Could not remove generic "
				   "information element from interface %s",
				   hapd->conf->iface);
		}
	}
	ieee802_1x_deinit(hapd);

#ifdef CONFIG_IEEE80211R
	l2_packet_deinit(hapd->l2);
#endif /* CONFIG_IEEE80211R */
}
Example #2
0
int rsn_preauth_iface_init(struct asd_data *wasd)
{
	char *tmp, *start, *end;

	if (wasd->conf->rsn_preauth_interfaces == NULL)
		return 0;

	tmp = os_strdup(wasd->conf->rsn_preauth_interfaces);
	if (tmp == NULL)
		return -1;
	start = tmp;
	for (;;) {
		while (*start == ' ')
			start++;
		if (*start == '\0')
			break;
		end = os_strchr(start, ' ');
		if (end)
			*end = '\0';

		if (rsn_preauth_iface_add(wasd, start)) {
			rsn_preauth_iface_deinit(wasd);
			return -1;
		}

		if (end)
			start = end + 1;
		else
			break;
	}
	os_free(tmp);
	return 0;
}