Remove unused leftover from multi-SSID design

The multi-SSID design that used a single beaconing BSSID with multiple
SSIDs was never completed in this repository, so there is no need to
maintain the per-STA ssid/ssid_probe pointers that could only point to
&hapd->conf->ssid. Save some memory and reduce code complexity by
removing this unused partial capability.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2015-04-21 00:33:25 +03:00 committed by Jouni Malinen
parent cb71a8342d
commit f41ded6fa4
8 changed files with 22 additions and 50 deletions

View file

@ -360,7 +360,6 @@ static u8 * hostapd_add_csa_elems(struct hostapd_data *hapd, u8 *pos,
static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
struct sta_info *sta,
const struct ieee80211_mgmt *req, const struct ieee80211_mgmt *req,
int is_p2p, size_t *resp_len) int is_p2p, size_t *resp_len)
{ {
@ -402,7 +401,7 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
/* hardware or low-level driver will setup seq_ctrl and timestamp */ /* hardware or low-level driver will setup seq_ctrl and timestamp */
resp->u.probe_resp.capab_info = resp->u.probe_resp.capab_info =
host_to_le16(hostapd_own_capab_info(hapd, sta, 1)); host_to_le16(hostapd_own_capab_info(hapd));
pos = resp->u.probe_resp.variable; pos = resp->u.probe_resp.variable;
*pos++ = WLAN_EID_SSID; *pos++ = WLAN_EID_SSID;
@ -548,7 +547,6 @@ void handle_probe_req(struct hostapd_data *hapd,
struct ieee802_11_elems elems; struct ieee802_11_elems elems;
const u8 *ie; const u8 *ie;
size_t ie_len; size_t ie_len;
struct sta_info *sta = NULL;
size_t i, resp_len; size_t i, resp_len;
int noack; int noack;
enum ssid_match_result res; enum ssid_match_result res;
@ -635,8 +633,6 @@ void handle_probe_req(struct hostapd_data *hapd,
return; return;
} }
sta = ap_get_sta(hapd, mgmt->sa);
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
if ((hapd->conf->p2p & P2P_GROUP_OWNER) && if ((hapd->conf->p2p & P2P_GROUP_OWNER) &&
elems.ssid_len == P2P_WILDCARD_SSID_LEN && elems.ssid_len == P2P_WILDCARD_SSID_LEN &&
@ -649,10 +645,7 @@ void handle_probe_req(struct hostapd_data *hapd,
res = ssid_match(hapd, elems.ssid, elems.ssid_len, res = ssid_match(hapd, elems.ssid, elems.ssid_len,
elems.ssid_list, elems.ssid_list_len); elems.ssid_list, elems.ssid_list_len);
if (res != NO_SSID_MATCH) { if (res == NO_SSID_MATCH) {
if (sta)
sta->ssid_probe = &hapd->conf->ssid;
} else {
if (!(mgmt->da[0] & 0x01)) { if (!(mgmt->da[0] & 0x01)) {
wpa_printf(MSG_MSGDUMP, "Probe Request from " MACSTR wpa_printf(MSG_MSGDUMP, "Probe Request from " MACSTR
" for foreign SSID '%s' (DA " MACSTR ")%s", " for foreign SSID '%s' (DA " MACSTR ")%s",
@ -719,7 +712,7 @@ void handle_probe_req(struct hostapd_data *hapd,
} }
#endif /* CONFIG_TESTING_OPTIONS */ #endif /* CONFIG_TESTING_OPTIONS */
resp = hostapd_gen_probe_resp(hapd, sta, mgmt, elems.p2p != NULL, resp = hostapd_gen_probe_resp(hapd, mgmt, elems.p2p != NULL,
&resp_len); &resp_len);
if (resp == NULL) if (resp == NULL)
return; return;
@ -774,7 +767,7 @@ static u8 * hostapd_probe_resp_offloads(struct hostapd_data *hapd,
"this"); "this");
/* Generate a Probe Response template for the non-P2P case */ /* Generate a Probe Response template for the non-P2P case */
return hostapd_gen_probe_resp(hapd, NULL, NULL, 0, resp_len); return hostapd_gen_probe_resp(hapd, NULL, 0, resp_len);
} }
#endif /* NEED_AP_MLME */ #endif /* NEED_AP_MLME */
@ -833,7 +826,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
host_to_le16(hapd->iconf->beacon_int); host_to_le16(hapd->iconf->beacon_int);
/* hardware or low-level driver will setup seq_ctrl and timestamp */ /* hardware or low-level driver will setup seq_ctrl and timestamp */
capab_info = hostapd_own_capab_info(hapd, NULL, 0); capab_info = hostapd_own_capab_info(hapd);
head->u.beacon.capab_info = host_to_le16(capab_info); head->u.beacon.capab_info = host_to_le16(capab_info);
pos = &head->u.beacon.variable[0]; pos = &head->u.beacon.variable[0];

View file

@ -132,8 +132,7 @@ u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid)
} }
u16 hostapd_own_capab_info(struct hostapd_data *hapd, struct sta_info *sta, u16 hostapd_own_capab_info(struct hostapd_data *hapd)
int probe)
{ {
int capab = WLAN_CAPABILITY_ESS; int capab = WLAN_CAPABILITY_ESS;
int privacy; int privacy;
@ -166,20 +165,6 @@ u16 hostapd_own_capab_info(struct hostapd_data *hapd, struct sta_info *sta,
privacy = 1; privacy = 1;
#endif /* CONFIG_HS20 */ #endif /* CONFIG_HS20 */
if (sta) {
int policy, def_klen;
if (probe && sta->ssid_probe) {
policy = sta->ssid_probe->security_policy;
def_klen = sta->ssid_probe->wep.default_len;
} else {
policy = sta->ssid->security_policy;
def_klen = sta->ssid->wep.default_len;
}
privacy = policy != SECURITY_PLAINTEXT;
if (policy == SECURITY_IEEE_802_1X && def_klen == 0)
privacy = 0;
}
if (privacy) if (privacy)
capab |= WLAN_CAPABILITY_PRIVACY; capab |= WLAN_CAPABILITY_PRIVACY;
@ -1594,7 +1579,7 @@ static void send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta,
send_len = IEEE80211_HDRLEN; send_len = IEEE80211_HDRLEN;
send_len += sizeof(reply->u.assoc_resp); send_len += sizeof(reply->u.assoc_resp);
reply->u.assoc_resp.capab_info = reply->u.assoc_resp.capab_info =
host_to_le16(hostapd_own_capab_info(hapd, sta, 0)); host_to_le16(hostapd_own_capab_info(hapd));
reply->u.assoc_resp.status_code = host_to_le16(status_code); reply->u.assoc_resp.status_code = host_to_le16(status_code);
reply->u.assoc_resp.aid = host_to_le16(sta->aid | BIT(14) | BIT(15)); reply->u.assoc_resp.aid = host_to_le16(sta->aid | BIT(14) | BIT(15));
/* Supported rates */ /* Supported rates */
@ -2335,7 +2320,7 @@ static void hostapd_set_wds_encryption(struct hostapd_data *hapd,
char *ifname_wds) char *ifname_wds)
{ {
int i; int i;
struct hostapd_ssid *ssid = sta->ssid; struct hostapd_ssid *ssid = &hapd->conf->ssid;
if (hapd->conf->ieee802_1x || hapd->conf->wpa) if (hapd->conf->ieee802_1x || hapd->conf->wpa)
return; return;

View file

@ -40,8 +40,7 @@ static inline int ieee802_11_get_mib_sta(struct hostapd_data *hapd,
return 0; return 0;
} }
#endif /* NEED_AP_MLME */ #endif /* NEED_AP_MLME */
u16 hostapd_own_capab_info(struct hostapd_data *hapd, struct sta_info *sta, u16 hostapd_own_capab_info(struct hostapd_data *hapd);
int probe);
void ap_ht2040_timeout(void *eloop_data, void *user_data); void ap_ht2040_timeout(void *eloop_data, void *user_data);
u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid); u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid);
u8 * hostapd_eid_qos_map_set(struct hostapd_data *hapd, u8 *eid); u8 * hostapd_eid_qos_map_set(struct hostapd_data *hapd, u8 *eid);

View file

@ -1652,7 +1652,7 @@ ieee802_1x_receive_auth(struct radius_msg *msg, struct radius_msg *req,
switch (hdr->code) { switch (hdr->code) {
case RADIUS_CODE_ACCESS_ACCEPT: case RADIUS_CODE_ACCESS_ACCEPT:
if (sta->ssid->dynamic_vlan == DYNAMIC_VLAN_DISABLED) if (hapd->conf->ssid.dynamic_vlan == DYNAMIC_VLAN_DISABLED)
vlan_id = 0; vlan_id = 0;
#ifndef CONFIG_NO_VLAN #ifndef CONFIG_NO_VLAN
else else
@ -1671,7 +1671,8 @@ ieee802_1x_receive_auth(struct radius_msg *msg, struct radius_msg *req,
"Invalid VLAN ID %d received from RADIUS server", "Invalid VLAN ID %d received from RADIUS server",
vlan_id); vlan_id);
break; break;
} else if (sta->ssid->dynamic_vlan == DYNAMIC_VLAN_REQUIRED) { } else if (hapd->conf->ssid.dynamic_vlan ==
DYNAMIC_VLAN_REQUIRED) {
sta->eapol_sm->authFail = TRUE; sta->eapol_sm->authFail = TRUE;
hostapd_logger(hapd, sta->addr, hostapd_logger(hapd, sta->addr,
HOSTAPD_MODULE_IEEE8021X, HOSTAPD_MODULE_IEEE8021X,

View file

@ -632,7 +632,6 @@ struct sta_info * ap_sta_add(struct hostapd_data *hapd, const u8 *addr)
hapd->sta_list = sta; hapd->sta_list = sta;
hapd->num_sta++; hapd->num_sta++;
ap_sta_hash_add(hapd, sta); ap_sta_hash_add(hapd, sta);
sta->ssid = &hapd->conf->ssid;
ap_sta_remove_in_other_bss(hapd, sta); ap_sta_remove_in_other_bss(hapd, sta);
sta->last_seq_ctrl = WLAN_INVALID_MGMT_SEQ; sta->last_seq_ctrl = WLAN_INVALID_MGMT_SEQ;
dl_list_init(&sta->ip6addr); dl_list_init(&sta->ip6addr);
@ -790,10 +789,10 @@ int ap_sta_bind_vlan(struct hostapd_data *hapd, struct sta_info *sta)
int old_vlanid = sta->vlan_id_bound; int old_vlanid = sta->vlan_id_bound;
iface = hapd->conf->iface; iface = hapd->conf->iface;
if (sta->ssid->vlan[0]) if (hapd->conf->ssid.vlan[0])
iface = sta->ssid->vlan; iface = hapd->conf->ssid.vlan;
if (sta->ssid->dynamic_vlan == DYNAMIC_VLAN_DISABLED) if (hapd->conf->ssid.dynamic_vlan == DYNAMIC_VLAN_DISABLED)
sta->vlan_id = 0; sta->vlan_id = 0;
else if (sta->vlan_id > 0) { else if (sta->vlan_id > 0) {
struct hostapd_vlan *wildcard_vlan = NULL; struct hostapd_vlan *wildcard_vlan = NULL;
@ -839,7 +838,7 @@ int ap_sta_bind_vlan(struct hostapd_data *hapd, struct sta_info *sta)
} }
iface = vlan->ifname; iface = vlan->ifname;
if (vlan_setup_encryption_dyn(hapd, sta->ssid, iface) != 0) { if (vlan_setup_encryption_dyn(hapd, iface) != 0) {
hostapd_logger(hapd, sta->addr, hostapd_logger(hapd, sta->addr,
HOSTAPD_MODULE_IEEE80211, HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_DEBUG, "could not " HOSTAPD_LEVEL_DEBUG, "could not "
@ -866,7 +865,7 @@ int ap_sta_bind_vlan(struct hostapd_data *hapd, struct sta_info *sta)
* configuration for the case where hostapd did not yet know * configuration for the case where hostapd did not yet know
* which keys are to be used when the interface was added. * which keys are to be used when the interface was added.
*/ */
if (vlan_setup_encryption_dyn(hapd, sta->ssid, iface) != 0) { if (vlan_setup_encryption_dyn(hapd, iface) != 0) {
hostapd_logger(hapd, sta->addr, hostapd_logger(hapd, sta->addr,
HOSTAPD_MODULE_IEEE80211, HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_DEBUG, "could not " HOSTAPD_LEVEL_DEBUG, "could not "

View file

@ -117,9 +117,6 @@ struct sta_info {
struct wpa_state_machine *wpa_sm; struct wpa_state_machine *wpa_sm;
struct rsn_preauth_interface *preauth_iface; struct rsn_preauth_interface *preauth_iface;
struct hostapd_ssid *ssid; /* SSID selection based on (Re)AssocReq */
struct hostapd_ssid *ssid_probe; /* SSID selection based on ProbeReq */
int vlan_id; /* 0: none, >0: VID */ int vlan_id; /* 0: none, >0: VID */
int vlan_id_bound; /* updated by ap_sta_bind_vlan() */ int vlan_id_bound; /* updated by ap_sta_bind_vlan() */
/* PSKs from RADIUS authentication server */ /* PSKs from RADIUS authentication server */

View file

@ -784,8 +784,7 @@ static void full_dynamic_vlan_deinit(struct full_dynamic_vlan *priv)
#endif /* CONFIG_FULL_DYNAMIC_VLAN */ #endif /* CONFIG_FULL_DYNAMIC_VLAN */
int vlan_setup_encryption_dyn(struct hostapd_data *hapd, int vlan_setup_encryption_dyn(struct hostapd_data *hapd, const char *dyn_vlan)
struct hostapd_ssid *mssid, const char *dyn_vlan)
{ {
int i; int i;
@ -795,10 +794,11 @@ int vlan_setup_encryption_dyn(struct hostapd_data *hapd,
/* Static WEP keys are set here; IEEE 802.1X and WPA uses their own /* Static WEP keys are set here; IEEE 802.1X and WPA uses their own
* functions for setting up dynamic broadcast keys. */ * functions for setting up dynamic broadcast keys. */
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (mssid->wep.key[i] && if (hapd->conf->ssid.wep.key[i] &&
hostapd_drv_set_key(dyn_vlan, hapd, WPA_ALG_WEP, NULL, i, hostapd_drv_set_key(dyn_vlan, hapd, WPA_ALG_WEP, NULL, i,
i == mssid->wep.idx, NULL, 0, i == hapd->conf->ssid.wep.idx, NULL, 0,
mssid->wep.key[i], mssid->wep.len[i])) hapd->conf->ssid.wep.key[i],
hapd->conf->ssid.wep.len[i]))
{ {
wpa_printf(MSG_ERROR, "VLAN: Could not set WEP " wpa_printf(MSG_ERROR, "VLAN: Could not set WEP "
"encryption for dynamic VLAN"); "encryption for dynamic VLAN");

View file

@ -18,7 +18,6 @@ struct hostapd_vlan * vlan_add_dynamic(struct hostapd_data *hapd,
int vlan_id); int vlan_id);
int vlan_remove_dynamic(struct hostapd_data *hapd, int vlan_id); int vlan_remove_dynamic(struct hostapd_data *hapd, int vlan_id);
int vlan_setup_encryption_dyn(struct hostapd_data *hapd, int vlan_setup_encryption_dyn(struct hostapd_data *hapd,
struct hostapd_ssid *mssid,
const char *dyn_vlan); const char *dyn_vlan);
#else /* CONFIG_NO_VLAN */ #else /* CONFIG_NO_VLAN */
static inline int vlan_init(struct hostapd_data *hapd) static inline int vlan_init(struct hostapd_data *hapd)
@ -43,7 +42,6 @@ static inline int vlan_remove_dynamic(struct hostapd_data *hapd, int vlan_id)
} }
static inline int vlan_setup_encryption_dyn(struct hostapd_data *hapd, static inline int vlan_setup_encryption_dyn(struct hostapd_data *hapd,
struct hostapd_ssid *mssid,
const char *dyn_vlan) const char *dyn_vlan)
{ {
return -1; return -1;