diff --git a/src/core/dhcp/nm-dhcp-nettools.c b/src/core/dhcp/nm-dhcp-nettools.c index 5571b279b2..04bedb878c 100644 --- a/src/core/dhcp/nm-dhcp-nettools.c +++ b/src/core/dhcp/nm-dhcp-nettools.c @@ -624,7 +624,7 @@ lease_to_ip4_config(NMDhcpNettools *self, NDhcp4ClientLease *lease, GError **err l3cd = nm_dhcp_client_create_l3cd(NM_DHCP_CLIENT(self)); - options = nm_dhcp_option_create_options_dict(); + options = nm_dhcp_option_create_options_dict(TRUE); if (!lease_parse_address(self, lease, l3cd, iface, options, &lease_address, error)) return NULL; diff --git a/src/core/dhcp/nm-dhcp-options.c b/src/core/dhcp/nm-dhcp-options.c index 172eb0492c..a5bb06d1c7 100644 --- a/src/core/dhcp/nm-dhcp-options.c +++ b/src/core/dhcp/nm-dhcp-options.c @@ -460,7 +460,7 @@ nm_dhcp_option_add_requests_to_options(GHashTable *options, int addr_family) } GHashTable * -nm_dhcp_option_create_options_dict(void) +nm_dhcp_option_create_options_dict(gboolean static_keys) { - return g_hash_table_new_full(nm_str_hash, g_str_equal, NULL, g_free); + return g_hash_table_new_full(nm_str_hash, g_str_equal, static_keys ? NULL : g_free, g_free); } diff --git a/src/core/dhcp/nm-dhcp-options.h b/src/core/dhcp/nm-dhcp-options.h index bdad8c94e8..fcc6f9cd08 100644 --- a/src/core/dhcp/nm-dhcp-options.h +++ b/src/core/dhcp/nm-dhcp-options.h @@ -222,7 +222,8 @@ void nm_dhcp_option_add_option_in_addr(GHashTable *options, in_addr_t value); void nm_dhcp_option_add_option_u64(GHashTable *options, int addr_family, guint option, guint64 value); -void nm_dhcp_option_add_requests_to_options(GHashTable *options, int addr_family); -GHashTable *nm_dhcp_option_create_options_dict(void); +void nm_dhcp_option_add_requests_to_options(GHashTable *options, int addr_family); + +GHashTable *nm_dhcp_option_create_options_dict(gboolean static_keys); #endif /* __NM_DHCP_OPTIONS_H__ */ diff --git a/src/core/dhcp/nm-dhcp-systemd.c b/src/core/dhcp/nm-dhcp-systemd.c index 9734b96f48..0bed14a82a 100644 --- a/src/core/dhcp/nm-dhcp-systemd.c +++ b/src/core/dhcp/nm-dhcp-systemd.c @@ -86,7 +86,7 @@ lease_to_ip6_config(NMDhcpSystemd *self, sd_dhcp6_lease *lease, gint32 ts, GErro l3cd = nm_dhcp_client_create_l3cd(NM_DHCP_CLIENT(self)); - options = nm_dhcp_option_create_options_dict(); + options = nm_dhcp_option_create_options_dict(TRUE); if (!nm_dhcp_client_get_config(NM_DHCP_CLIENT(self))->v6.info_only) { gboolean has_any_addresses = FALSE;