summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-08-31 09:42:19 +0200
committerThomas Haller <thaller@redhat.com>2022-08-31 09:47:48 +0200
commit6b74f3cc1436b95111bdfa1b782b4bb6100ba33a (patch)
tree7d5d5d23045d1b2b302f25e408e71df4ec71d5b0
parent4c48864972378c0b97b15914ee7039bbce8e7274 (diff)
downloadNetworkManager-6b74f3cc1436b95111bdfa1b782b4bb6100ba33a.tar.gz
cloud-setup,glib-aux: use NULL instead of g_direct_equal() for hash tables
-rw-r--r--src/libnm-glib-aux/tests/test-shared-general.c2
-rw-r--r--src/nm-cloud-setup/main.c13
2 files changed, 7 insertions, 8 deletions
diff --git a/src/libnm-glib-aux/tests/test-shared-general.c b/src/libnm-glib-aux/tests/test-shared-general.c
index e6e57c5218..5d9072e177 100644
--- a/src/libnm-glib-aux/tests/test-shared-general.c
+++ b/src/libnm-glib-aux/tests/test-shared-general.c
@@ -1284,7 +1284,7 @@ test_utils_hashtable_cmp(void)
for (test_run = 0; test_run < 30; test_run++) {
for (is_num_key = 0; is_num_key < 2; is_num_key++) {
GHashFunc func_key_hash = is_num_key ? nm_direct_hash : nm_str_hash;
- GEqualFunc func_key_equal = is_num_key ? g_direct_equal : g_str_equal;
+ GEqualFunc func_key_equal = is_num_key ? NULL : g_str_equal;
GCompareDataFunc func_key_cmp =
is_num_key ? _hash_func_cmp_direct : (GCompareDataFunc) nm_strcmp_with_data;
GCompareDataFunc func_val_cmp =
diff --git a/src/nm-cloud-setup/main.c b/src/nm-cloud-setup/main.c
index 6f4e06605a..026c6701b4 100644
--- a/src/nm-cloud-setup/main.c
+++ b/src/nm-cloud-setup/main.c
@@ -337,13 +337,12 @@ _nmc_mangle_connection(NMDevice *device,
* We don't need to configure policy routing in this case. */
NM_SET_OUT(out_skipped_single_addr, TRUE);
} else if (config_data->has_ipv4s && config_data->has_cidr) {
- gs_unref_hashtable GHashTable *unique_subnets =
- g_hash_table_new(nm_direct_hash, g_direct_equal);
- NMIPAddress *addr_entry;
- NMIPRoute *route_entry;
- NMIPRoutingRule *rule_entry;
- in_addr_t gateway;
- char sbuf[NM_INET_ADDRSTRLEN];
+ gs_unref_hashtable GHashTable *unique_subnets = g_hash_table_new(nm_direct_hash, NULL);
+ NMIPAddress *addr_entry;
+ NMIPRoute *route_entry;
+ NMIPRoutingRule *rule_entry;
+ in_addr_t gateway;
+ char sbuf[NM_INET_ADDRSTRLEN];
for (i = 0; i < config_data->ipv4s_len; i++) {
addr_entry = nm_ip_address_new_binary(AF_INET,