linked-list: Change return value of find_first() and signature of its callback

This avoids the unportable five pointer hack.
This commit is contained in:
Tobias Brunner
2017-05-26 13:56:44 +02:00
parent 8a2e4d4a8b
commit 2e4d110d1e
29 changed files with 526 additions and 398 deletions
+7 -6
View File
@@ -81,11 +81,12 @@ typedef struct {
bool check_delete_action;
} entry_t;
/**
* Check if the given entry is for the same CHILD_SA
*/
static bool match_child(entry_t *entry, child_sa_t *child_sa)
CALLBACK(match_child, bool,
entry_t *entry, va_list args)
{
child_sa_t *child_sa;
VA_ARGS_VGET(args, child_sa);
return entry->child_sa == child_sa;
}
@@ -252,8 +253,8 @@ static void process_payloads(private_child_delete_t *this, message_t *message)
DBG1(DBG_IKE, "received DELETE for %N CHILD_SA with SPI %.8x",
protocol_id_names, protocol, ntohl(spi));
if (this->child_sas->find_first(this->child_sas,
(void*)match_child, NULL, child_sa) == SUCCESS)
if (this->child_sas->find_first(this->child_sas, match_child,
NULL, child_sa))
{
continue;
}