mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-17 18:34:03 -05:00
ap_list: Remove unused iteration list pointers
This iter_next/iter_prev pointers were not really used for anything, so get rid of the unnecessary complexity in the AP list maintenance. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
6b16917f39
commit
08c99cafd2
@ -87,34 +87,6 @@ static void ap_ap_list_del(struct hostapd_iface *iface, struct ap_info *ap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void ap_ap_iter_list_add(struct hostapd_iface *iface,
|
|
||||||
struct ap_info *ap)
|
|
||||||
{
|
|
||||||
if (iface->ap_iter_list) {
|
|
||||||
ap->iter_prev = iface->ap_iter_list->iter_prev;
|
|
||||||
iface->ap_iter_list->iter_prev = ap;
|
|
||||||
} else
|
|
||||||
ap->iter_prev = ap;
|
|
||||||
ap->iter_next = iface->ap_iter_list;
|
|
||||||
iface->ap_iter_list = ap;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void ap_ap_iter_list_del(struct hostapd_iface *iface,
|
|
||||||
struct ap_info *ap)
|
|
||||||
{
|
|
||||||
if (iface->ap_iter_list == ap)
|
|
||||||
iface->ap_iter_list = ap->iter_next;
|
|
||||||
else
|
|
||||||
ap->iter_prev->iter_next = ap->iter_next;
|
|
||||||
|
|
||||||
if (ap->iter_next)
|
|
||||||
ap->iter_next->iter_prev = ap->iter_prev;
|
|
||||||
else if (iface->ap_iter_list)
|
|
||||||
iface->ap_iter_list->iter_prev = ap->iter_prev;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void ap_ap_hash_add(struct hostapd_iface *iface, struct ap_info *ap)
|
static void ap_ap_hash_add(struct hostapd_iface *iface, struct ap_info *ap)
|
||||||
{
|
{
|
||||||
ap->hnext = iface->ap_hash[STA_HASH(ap->addr)];
|
ap->hnext = iface->ap_hash[STA_HASH(ap->addr)];
|
||||||
@ -148,7 +120,6 @@ static void ap_free_ap(struct hostapd_iface *iface, struct ap_info *ap)
|
|||||||
{
|
{
|
||||||
ap_ap_hash_del(iface, ap);
|
ap_ap_hash_del(iface, ap);
|
||||||
ap_ap_list_del(iface, ap);
|
ap_ap_list_del(iface, ap);
|
||||||
ap_ap_iter_list_del(iface, ap);
|
|
||||||
|
|
||||||
iface->num_ap--;
|
iface->num_ap--;
|
||||||
os_free(ap);
|
os_free(ap);
|
||||||
@ -203,7 +174,6 @@ static struct ap_info * ap_ap_add(struct hostapd_iface *iface, const u8 *addr)
|
|||||||
ap_ap_list_add(iface, ap);
|
ap_ap_list_add(iface, ap);
|
||||||
iface->num_ap++;
|
iface->num_ap++;
|
||||||
ap_ap_hash_add(iface, ap);
|
ap_ap_hash_add(iface, ap);
|
||||||
ap_ap_iter_list_add(iface, ap);
|
|
||||||
|
|
||||||
if (iface->num_ap > iface->conf->ap_table_max_size && ap != ap->prev) {
|
if (iface->num_ap > iface->conf->ap_table_max_size && ap != ap->prev) {
|
||||||
wpa_printf(MSG_DEBUG, "Removing the least recently used AP "
|
wpa_printf(MSG_DEBUG, "Removing the least recently used AP "
|
||||||
|
@ -14,15 +14,10 @@
|
|||||||
struct ap_info {
|
struct ap_info {
|
||||||
/* Note: next/prev pointers are updated whenever a new beacon is
|
/* Note: next/prev pointers are updated whenever a new beacon is
|
||||||
* received because these are used to find the least recently used
|
* received because these are used to find the least recently used
|
||||||
* entries. iter_next/iter_prev are updated only when adding new BSSes
|
* entries. */
|
||||||
* and when removing old ones. These should be used when iterating
|
|
||||||
* through the table in a manner that allows beacons to be received
|
|
||||||
* during the iteration. */
|
|
||||||
struct ap_info *next; /* next entry in AP list */
|
struct ap_info *next; /* next entry in AP list */
|
||||||
struct ap_info *prev; /* previous entry in AP list */
|
struct ap_info *prev; /* previous entry in AP list */
|
||||||
struct ap_info *hnext; /* next entry in hash table list */
|
struct ap_info *hnext; /* next entry in hash table list */
|
||||||
struct ap_info *iter_next; /* next entry in AP iteration list */
|
|
||||||
struct ap_info *iter_prev; /* previous entry in AP iteration list */
|
|
||||||
u8 addr[6];
|
u8 addr[6];
|
||||||
u8 supported_rates[WLAN_SUPP_RATES_MAX];
|
u8 supported_rates[WLAN_SUPP_RATES_MAX];
|
||||||
int erp; /* ERP Info or -1 if ERP info element not present */
|
int erp; /* ERP Info or -1 if ERP info element not present */
|
||||||
|
@ -220,7 +220,6 @@ struct hostapd_iface {
|
|||||||
int num_ap; /* number of entries in ap_list */
|
int num_ap; /* number of entries in ap_list */
|
||||||
struct ap_info *ap_list; /* AP info list head */
|
struct ap_info *ap_list; /* AP info list head */
|
||||||
struct ap_info *ap_hash[STA_HASH_SIZE];
|
struct ap_info *ap_hash[STA_HASH_SIZE];
|
||||||
struct ap_info *ap_iter_list;
|
|
||||||
|
|
||||||
unsigned int drv_flags;
|
unsigned int drv_flags;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user