mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-03 21:48:21 +02:00
dhcp: add and use nm_dhcp_client_create_options_dict()
This will be used to pre-fill the lease with client-specific options.
This commit is contained in:
parent
ccbe76b81d
commit
c020f618ed
4 changed files with 15 additions and 3 deletions
|
|
@ -237,6 +237,16 @@ nm_dhcp_client_create_l3cd(NMDhcpClient *self)
|
|||
NM_IP_CONFIG_SOURCE_DHCP);
|
||||
}
|
||||
|
||||
GHashTable *
|
||||
nm_dhcp_client_create_options_dict(NMDhcpClient *self, gboolean static_keys)
|
||||
{
|
||||
GHashTable *options;
|
||||
|
||||
options = nm_dhcp_option_create_options_dict(static_keys);
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
void
|
||||
|
|
@ -1613,7 +1623,7 @@ nm_dhcp_client_handle_event(gpointer unused,
|
|||
GVariant *value;
|
||||
|
||||
/* Copy options */
|
||||
str_options = nm_dhcp_option_create_options_dict(FALSE);
|
||||
str_options = nm_dhcp_client_create_options_dict(self, FALSE);
|
||||
g_variant_iter_init(&iter, options);
|
||||
while (g_variant_iter_next(&iter, "{&sv}", &name, &value)) {
|
||||
maybe_add_option(self, str_options, name, value);
|
||||
|
|
|
|||
|
|
@ -280,6 +280,8 @@ GBytes *nm_dhcp_client_get_effective_client_id(NMDhcpClient *self);
|
|||
|
||||
NML3ConfigData *nm_dhcp_client_create_l3cd(NMDhcpClient *self);
|
||||
|
||||
GHashTable *nm_dhcp_client_create_options_dict(NMDhcpClient *self, gboolean static_keys);
|
||||
|
||||
/*****************************************************************************
|
||||
* Client data
|
||||
*****************************************************************************/
|
||||
|
|
|
|||
|
|
@ -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(TRUE);
|
||||
options = nm_dhcp_client_create_options_dict(NM_DHCP_CLIENT(self), TRUE);
|
||||
|
||||
if (!lease_parse_address(self, lease, l3cd, iface, options, &lease_address, error))
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -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(TRUE);
|
||||
options = nm_dhcp_client_create_options_dict(NM_DHCP_CLIENT(self), 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