diff --git a/src/utils.c b/src/utils.c index 8623d8b..a8e4e95 100644 --- a/src/utils.c +++ b/src/utils.c @@ -277,7 +277,7 @@ void string_destroy_notify(gpointer str) { guint hash_ipv4(gconstpointer key) { - return GPOINTER_TO_UINT(key); + return *((guint*)key); } guint hash_ipv6(gconstpointer key) { diff --git a/src/utils.h b/src/utils.h index 74466ab..2c71dbb 100644 --- a/src/utils.h +++ b/src/utils.h @@ -26,7 +26,9 @@ LI_API gchar *ev_backend_string(guint backend); LI_API void string_destroy_notify(gpointer str); +/* expects a pointer to a 32bit value */ LI_API guint hash_ipv4(gconstpointer key); +/* expects a pointer to a 128bit value */ LI_API guint hash_ipv6(gconstpointer key); #endif