When an entry is added to the PTKSA cache, timer expiration is not set.
Check the list and set the timer expiration when the list is empty also.
When another entry is added to the list, it is placed before the relavant
entry in the order of expiry time of all entries present in the list.
Fixes: a4e36916168a ("WPA: Add PTKSA cache implementation")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
{
struct ptksa_cache_entry *entry, *tmp, *tmp2 = NULL;
struct os_reltime now;
+ bool set_expiry = false;
if (!ptksa || !ptk || !addr || !life_time || cipher == WPA_CIPHER_NONE)
return NULL;
}
}
+ if (dl_list_empty(&entry->list))
+ set_expiry = true;
/*
* If the expiration is later then all other or the list is empty
* entries, add it to the end of the list;
"Added PTKSA cache entry addr=" MACSTR " cipher=%u",
MAC2STR(addr), cipher);
+ if (set_expiry)
+ ptksa_cache_set_expiration(ptksa);
+
return entry;
}