]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
eap-radius: Fix incompatible function types warnings
authorTobias Brunner <tobias@strongswan.org>
Wed, 17 Nov 2021 17:09:39 +0000 (18:09 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 17 Nov 2021 17:18:09 +0000 (18:18 +0100)
src/libcharon/plugins/eap_radius/eap_radius_dae.c
src/libcharon/plugins/eap_radius/eap_radius_provider.c

index fc9b39c3e1bb4dd091989ed4674998f25f542036..9a5535ea26bee7437fc45548804d2fc174a6c5f5 100644 (file)
@@ -379,7 +379,8 @@ static void process_coa(private_eap_radius_dae_t *this,
 /**
  * Receive RADIUS DAE requests
  */
-static bool receive(private_eap_radius_dae_t *this)
+CALLBACK(receive, bool,
+       private_eap_radius_dae_t *this, int fd, watcher_event_t event)
 {
        struct sockaddr_storage addr;
        socklen_t addr_len = sizeof(addr);
@@ -530,8 +531,7 @@ eap_radius_dae_t *eap_radius_dae_create(eap_radius_accounting_t *accounting)
                return NULL;
        }
 
-       lib->watcher->add(lib->watcher, this->fd, WATCHER_READ,
-                                         (watcher_cb_t)receive, this);
+       lib->watcher->add(lib->watcher, this->fd, WATCHER_READ, receive, this);
 
        return &this->public;
 }
index defabb7827f12e732b75b143b93b0bd2d9b1b3eb..dfcd7be98fb904ee5519ffcb122a33406cf59111 100644 (file)
@@ -152,17 +152,18 @@ static void put_or_destroy_entry(hashtable_t *hashtable, entry_t *entry)
 /**
  * Hashtable hash function
  */
-static u_int hash(uintptr_t id)
+static u_int hash(const void *key)
 {
-       return id;
+       uintptr_t id = (uintptr_t)key;
+       return chunk_hash(chunk_from_thing(id));
 }
 
 /**
  * Hashtable equals function
  */
-static bool equals(uintptr_t a, uintptr_t b)
+static bool equals(const void *a, const void *b)
 {
-       return a == b;
+       return (uintptr_t)a == (uintptr_t)b;
 }
 
 /**
@@ -553,10 +554,8 @@ eap_radius_provider_t *eap_radius_provider_create()
                                        .ike_rekey = _ike_rekey,
                                        .message = _message_hook,
                                },
-                               .claimed = hashtable_create((hashtable_hash_t)hash,
-                                                                               (hashtable_equals_t)equals, 32),
-                               .unclaimed = hashtable_create((hashtable_hash_t)hash,
-                                                                               (hashtable_equals_t)equals, 32),
+                               .claimed = hashtable_create(hash, equals, 32),
+                               .unclaimed = hashtable_create(hash, equals, 32),
                                .mutex = mutex_create(MUTEX_TYPE_DEFAULT),
                        },
                );