From bba25e2ff6c4a193acb54560ea4417537bd2954e Mon Sep 17 00:00:00 2001 From: Yves-Alexis Perez Date: Tue, 30 May 2017 20:59:31 +0200 Subject: New upstream version 5.5.3 --- src/libsimaka/simaka_message.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'src/libsimaka/simaka_message.c') diff --git a/src/libsimaka/simaka_message.c b/src/libsimaka/simaka_message.c index 234d7ef2a..6827c1795 100644 --- a/src/libsimaka/simaka_message.c +++ b/src/libsimaka/simaka_message.c @@ -222,17 +222,22 @@ METHOD(simaka_message_t, get_type, eap_type_t, return this->hdr->type; } -/** - * convert attr_t to type and data enumeration - */ -static bool attr_enum_filter(void *null, attr_t **in, simaka_attribute_t *type, - void *dummy, chunk_t *data) +CALLBACK(attr_enum_filter, bool, + void *null, enumerator_t *orig, va_list args) { - attr_t *attr = *in; + attr_t *attr; + simaka_attribute_t *type; + chunk_t *data; - *type = attr->type; - *data = chunk_create(attr->data, attr->len); - return TRUE; + VA_ARGS_VGET(args, type, data); + + if (orig->enumerate(orig, &attr)) + { + *type = attr->type; + *data = chunk_create(attr->data, attr->len); + return TRUE; + } + return FALSE; } METHOD(simaka_message_t, create_attribute_enumerator, enumerator_t*, @@ -240,7 +245,7 @@ METHOD(simaka_message_t, create_attribute_enumerator, enumerator_t*, { return enumerator_create_filter( this->attributes->create_enumerator(this->attributes), - (void*)attr_enum_filter, NULL, NULL); + attr_enum_filter, NULL, NULL); } METHOD(simaka_message_t, add_attribute, void, -- cgit v1.2.3