mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-02-12 08:41:51 +00:00
datastorage: fix multi-SSID
Bug that could proably cause ineffciency or confusion in multi-SSID environments. Adjusted erroneus match test in ap_array_insert(). Signed-off-by: Ian Clowes <clowes_ian@hotmail.com>
This commit is contained in:
parent
9187665f8e
commit
9ce01ecce5
1 changed files with 2 additions and 5 deletions
|
@ -1233,15 +1233,12 @@ ap *insert_to_ap_array(ap* entry, time_t expiry) {
|
||||||
|
|
||||||
pthread_mutex_lock(&ap_array_mutex);
|
pthread_mutex_lock(&ap_array_mutex);
|
||||||
|
|
||||||
// TODO: Why do we delete and add here?
|
// TODO: Why do we delete and add here rather than update existing?
|
||||||
ap* old_entry = *ap_array_find_first_entry(entry->bssid_addr, entry->ssid);
|
ap* old_entry = *ap_array_find_first_entry(entry->bssid_addr, entry->ssid);
|
||||||
|
|
||||||
if (old_entry != NULL &&
|
if (old_entry != NULL &&
|
||||||
!mac_is_equal_bb((old_entry)->bssid_addr, entry->bssid_addr) &&
|
mac_is_equal_bb((old_entry)->bssid_addr, entry->bssid_addr) &&
|
||||||
!strcmp((char*)old_entry->ssid, (char*)entry->ssid))
|
!strcmp((char*)old_entry->ssid, (char*)entry->ssid))
|
||||||
old_entry = NULL;
|
|
||||||
|
|
||||||
if (old_entry != NULL)
|
|
||||||
ap_array_delete(old_entry);
|
ap_array_delete(old_entry);
|
||||||
|
|
||||||
entry->time = expiry;
|
entry->time = expiry;
|
||||||
|
|
Loading…
Reference in a new issue