mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 10:08:05 +02:00
dhcp: implement dhcp-vendor-class-identifier option for internal DHCP client
https://bugzilla.redhat.com/show_bug.cgi?id=1871042 Signed-off-by: Antonio Cardace <acardace@redhat.com>
This commit is contained in:
parent
f71f40bc20
commit
f8a7290153
1 changed files with 20 additions and 0 deletions
|
|
@ -1333,6 +1333,7 @@ ip4_start (NMDhcpClient *client,
|
||||||
struct in_addr last_addr = { 0 };
|
struct in_addr last_addr = { 0 };
|
||||||
const char *hostname;
|
const char *hostname;
|
||||||
const char *mud_url;
|
const char *mud_url;
|
||||||
|
GBytes *vendor_class_identifier;
|
||||||
int r, i;
|
int r, i;
|
||||||
|
|
||||||
g_return_val_if_fail (!priv->probe, FALSE);
|
g_return_val_if_fail (!priv->probe, FALSE);
|
||||||
|
|
@ -1454,6 +1455,25 @@ ip4_start (NMDhcpClient *client,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vendor_class_identifier = nm_dhcp_client_get_vendor_class_identifier (client);
|
||||||
|
if (vendor_class_identifier) {
|
||||||
|
const void *option_data;
|
||||||
|
gsize option_size;
|
||||||
|
|
||||||
|
option_data = g_bytes_get_data (vendor_class_identifier, &option_size);
|
||||||
|
nm_assert (option_data);
|
||||||
|
nm_assert (option_size <= 255);
|
||||||
|
|
||||||
|
r = n_dhcp4_client_probe_config_append_option (config,
|
||||||
|
NM_DHCP_OPTION_DHCP4_VENDOR_CLASS_IDENTIFIER,
|
||||||
|
option_data,
|
||||||
|
option_size);
|
||||||
|
if (r) {
|
||||||
|
set_error_nettools (error, r, "failed to set vendor class identifier");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
g_free (priv->lease_file);
|
g_free (priv->lease_file);
|
||||||
priv->lease_file = g_steal_pointer (&lease_file);
|
priv->lease_file = g_steal_pointer (&lease_file);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue