mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-04 23:50:16 +01:00
dhcp: nettools: parse the filename and the bootfile-name option
This commit is contained in:
parent
6a1349c5fb
commit
3c79944e15
1 changed files with 25 additions and 0 deletions
|
|
@ -703,6 +703,31 @@ lease_to_ip4_config(NMDedupMultiIndex *multi_idx,
|
|||
nm_ip4_config_set_nis_domain(ip4_config, v_str ?: "");
|
||||
}
|
||||
|
||||
r = n_dhcp4_client_lease_get_file(lease, &v_str);
|
||||
if (r == 0) {
|
||||
gs_free char *to_free = NULL;
|
||||
|
||||
v_str = nm_utils_buf_utf8safe_escape(v_str,
|
||||
-1,
|
||||
NM_UTILS_STR_UTF8_SAFE_FLAG_ESCAPE_CTRL,
|
||||
&to_free);
|
||||
nm_dhcp_option_add_option(options, AF_INET, NM_DHCP_OPTION_DHCP4_NM_FILENAME, v_str ?: "");
|
||||
}
|
||||
|
||||
r = _client_lease_query(lease, NM_DHCP_OPTION_DHCP4_BOOTFILE_NAME, &l_data, &l_data_len);
|
||||
if (r == 0 && nm_dhcp_lease_data_parse_cstr(l_data, l_data_len, &l_data_len)) {
|
||||
gs_free char *to_free = NULL;
|
||||
|
||||
v_str = nm_utils_buf_utf8safe_escape((char *) l_data,
|
||||
l_data_len,
|
||||
NM_UTILS_STR_UTF8_SAFE_FLAG_ESCAPE_CTRL,
|
||||
&to_free);
|
||||
nm_dhcp_option_add_option(options,
|
||||
AF_INET,
|
||||
NM_DHCP_OPTION_DHCP4_BOOTFILE_NAME,
|
||||
v_str ?: "");
|
||||
}
|
||||
|
||||
lease_parse_address_list(lease, ip4_config, NM_DHCP_OPTION_DHCP4_NIS_SERVERS, options, &sbuf);
|
||||
|
||||
lease_parse_address_list(lease,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue