network: add roaming consortium IE to network object

This is duplicated when the first scan_bss is added to a network
object that contains the IE. Any future BSS's added will not re-add
the IE. Its assumed that all BSS's under a network will contain the
same roaming consortium OIs.
This commit is contained in:
James Prestwood 2019-07-12 10:30:27 -07:00 committed by Denis Kenzior
parent 9dcb6946c5
commit aeae6abcbb
2 changed files with 13 additions and 0 deletions

View File

@ -64,6 +64,7 @@ struct network {
struct l_queue *blacklist; /* temporary blacklist for BSS's */
uint8_t hessid[6];
char **nai_realms;
uint8_t *rc_ie;
bool update_psk:1; /* Whether PSK should be written to storage */
bool ask_passphrase:1; /* Whether we should force-ask agent */
int rank;
@ -562,6 +563,11 @@ char **network_get_nai_realms(struct network *network)
return network->nai_realms;
}
const uint8_t *network_get_roaming_consortium(struct network *network)
{
return network->rc_ie;
}
static inline bool __bss_is_sae(const struct scan_bss *bss,
const struct ie_rsn_info *rsn)
{
@ -704,6 +710,9 @@ bool network_bss_add(struct network *network, struct scan_bss *bss)
if (!util_mem_is_zero(bss->hessid, 6))
memcpy(network->hessid, bss->hessid, 6);
if (bss->rc_ie && !network->rc_ie)
network->rc_ie = l_memdup(bss->rc_ie, bss->rc_ie[1] + 2);
return true;
}
@ -1363,6 +1372,9 @@ void network_remove(struct network *network, int reason)
if (network->nai_realms)
l_strv_free(network->nai_realms);
if (network->rc_ie)
l_free(network->rc_ie);
l_free(network);
}

View File

@ -52,6 +52,7 @@ void network_set_hessid(struct network *network, uint8_t *hessid);
void network_set_nai_realms(struct network *network, char **realms);
uint8_t *network_get_hessid(struct network *network);
char **network_get_nai_realms(struct network *network);
const uint8_t *network_get_roaming_consortium(struct network *network);
int network_autoconnect(struct network *network, struct scan_bss *bss);
void network_connect_failed(struct network *network);