]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: use dns_name_hash_ops_free in dnssec negative trust anchors
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 11 Apr 2025 01:56:12 +0000 (10:56 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 13 Apr 2025 01:09:45 +0000 (10:09 +0900)
src/network/networkd-dns.c
src/network/networkd-link-bus.c
src/network/networkd-link.c
src/network/networkd-network.c

index a8164912dc1d622249ff1db8c27646631b67a2b1..bc3bc65c200193c66f1e52c8660657a6e2356c24 100644 (file)
@@ -281,7 +281,7 @@ int config_parse_dnssec_negative_trust_anchors(
         assert(rvalue);
 
         if (isempty(rvalue)) {
-                *nta = set_free_free(*nta);
+                *nta = set_free(*nta);
                 return 0;
         }
 
@@ -306,7 +306,7 @@ int config_parse_dnssec_negative_trust_anchors(
                         continue;
                 }
 
-                r = set_ensure_consume(nta, &dns_name_hash_ops, TAKE_PTR(w));
+                r = set_ensure_consume(nta, &dns_name_hash_ops_free, TAKE_PTR(w));
                 if (r < 0)
                         return log_oom();
         }
index 27ee855181e9d86c369c9ed60da002167ae0cbb0..dfecd76d22624664b8b9149eb843bc8c20056e15 100644 (file)
@@ -479,7 +479,7 @@ int bus_link_method_set_dnssec(sd_bus_message *message, void *userdata, sd_bus_e
 }
 
 int bus_link_method_set_dnssec_negative_trust_anchors(sd_bus_message *message, void *userdata, sd_bus_error *error) {
-        _cleanup_set_free_free_ Set *ns = NULL;
+        _cleanup_set_free_ Set *ns = NULL;
         _cleanup_strv_free_ char **ntas = NULL;
         Link *l = ASSERT_PTR(userdata);
         int r;
@@ -502,7 +502,7 @@ int bus_link_method_set_dnssec_negative_trust_anchors(sd_bus_message *message, v
                         return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid negative trust anchor domain: %s", *i);
         }
 
-        ns = set_new(&dns_name_hash_ops);
+        ns = set_new(&dns_name_hash_ops_free);
         if (!ns)
                 return -ENOMEM;
 
@@ -523,8 +523,7 @@ int bus_link_method_set_dnssec_negative_trust_anchors(sd_bus_message *message, v
         if (r == 0)
                 return 1; /* Polkit will call us back */
 
-        set_free_free(l->dnssec_negative_trust_anchors);
-        l->dnssec_negative_trust_anchors = TAKE_PTR(ns);
+        set_free_and_replace(l->dnssec_negative_trust_anchors, ns);
 
         r = link_save_and_clean_full(l, /* also_save_manager = */ true);
         if (r < 0)
index 8a8c41eaacd4058805e68c4f4f963ffdf8e2e1cd..fdb9e52a8114136a75a4135a88001836b85a97f9 100644 (file)
@@ -231,7 +231,7 @@ void link_dns_settings_clear(Link *link) {
         link->dnssec_mode = _DNSSEC_MODE_INVALID;
         link->dns_over_tls_mode = _DNS_OVER_TLS_MODE_INVALID;
 
-        link->dnssec_negative_trust_anchors = set_free_free(link->dnssec_negative_trust_anchors);
+        link->dnssec_negative_trust_anchors = set_free(link->dnssec_negative_trust_anchors);
 }
 
 static void link_free_engines(Link *link) {
index 00851243b5ac7176ee159d6298191fba53014de2..db36893d95790178e597cecac88567c75b738bad 100644 (file)
@@ -752,7 +752,7 @@ static Network *network_free(Network *network) {
         free(network->dns);
         ordered_set_free(network->search_domains);
         ordered_set_free(network->route_domains);
-        set_free_free(network->dnssec_negative_trust_anchors);
+        set_free(network->dnssec_negative_trust_anchors);
 
         /* DHCP server */
         free(network->dhcp_server_relay_agent_circuit_id);