mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-30 03:50:10 +01:00
dhcp: add static-keys argument to nm_dhcp_option_create_options_dict()
This is so that we can use the same function also to create the
hash for dhclient plugin.
(cherry picked from commit 492818b529)
This commit is contained in:
parent
2987bb7e8d
commit
63a6bc1bc9
4 changed files with 7 additions and 6 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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__ */
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue