From 1ea72435dae474b768752cb1d57e7112bd04b664 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Mon, 30 Nov 2020 22:32:33 +0100 Subject: [PATCH] dns: sd-resolved: fix hash table iteration g_hash_table_iter_next() wants a (gpointer *), not an (int *). Fixes: f70ee67058c9 ('dns: sd-resolved: reset interface configuration on deactivation') (cherry picked from commit 526b484be1981b4bfcc5e48d5480c6ac7ccd8b66) (cherry picked from commit dedcba61ef79c09c40eeaea3aa90a871097cbda3) (cherry picked from commit b42696d70b08ecd2fa4aa3854acc297e1ac18f38) --- src/dns/nm-dns-systemd-resolved.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dns/nm-dns-systemd-resolved.c b/src/dns/nm-dns-systemd-resolved.c index 621a269cca..fee7986375 100644 --- a/src/dns/nm-dns-systemd-resolved.c +++ b/src/dns/nm-dns-systemd-resolved.c @@ -358,6 +358,7 @@ update (NMDnsPlugin *plugin, gs_free gpointer *interfaces_keys = NULL; guint interfaces_len; int ifindex; + gpointer pointer; NMDnsIPConfigData *ip_data; GHashTableIter iter; guint i; @@ -402,7 +403,8 @@ update (NMDnsPlugin *plugin, * resolved, and the current update doesn't contain that interface, * reset the resolved configuration for that ifindex. */ g_hash_table_iter_init (&iter, priv->dirty_interfaces); - while (g_hash_table_iter_next (&iter, (gpointer *) &ifindex, NULL)) { + while (g_hash_table_iter_next (&iter, (gpointer *) &pointer, NULL)) { + ifindex = GPOINTER_TO_INT (pointer); if (!g_hash_table_contains (interfaces, GINT_TO_POINTER (ifindex))) { InterfaceConfig ic;