77#include "networkd-network.h"
88#include "networkd-util.h"
99
10- DEFINE_SECTION_CLEANUP_FUNCTIONS (DHCPStaticLease , dhcp_static_lease_free );
11-
12- DHCPStaticLease * dhcp_static_lease_free (DHCPStaticLease * static_lease ) {
10+ static DHCPStaticLease * dhcp_static_lease_free (DHCPStaticLease * static_lease ) {
1311 if (!static_lease )
1412 return NULL ;
1513
@@ -21,6 +19,13 @@ DHCPStaticLease *dhcp_static_lease_free(DHCPStaticLease *static_lease) {
2119 return mfree (static_lease );
2220}
2321
22+ DEFINE_SECTION_CLEANUP_FUNCTIONS (DHCPStaticLease , dhcp_static_lease_free );
23+
24+ DEFINE_PRIVATE_HASH_OPS_WITH_VALUE_DESTRUCTOR (
25+ static_lease_hash_ops_by_section ,
26+ ConfigSection , config_section_hash_func , config_section_compare_func ,
27+ DHCPStaticLease , dhcp_static_lease_free );
28+
2429static int dhcp_static_lease_new (DHCPStaticLease * * ret ) {
2530 DHCPStaticLease * p ;
2631
@@ -60,7 +65,8 @@ static int lease_new_static(Network *network, const char *filename, unsigned sec
6065
6166 static_lease -> network = network ;
6267 static_lease -> section = TAKE_PTR (n );
63- r = hashmap_ensure_put (& network -> dhcp_static_leases_by_section , & config_section_hash_ops , static_lease -> section , static_lease );
68+
69+ r = hashmap_ensure_put (& network -> dhcp_static_leases_by_section , & static_lease_hash_ops_by_section , static_lease -> section , static_lease );
6470 if (r < 0 )
6571 return r ;
6672
0 commit comments