mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-04 15:40:22 +01:00
dhcp: drop unused nm_dhcp_dhclient_get_client_id_from_config_file()
Drop unused function. Aside from that, dhclient configuration files support a very complex syntax. The parser was very naive and insufficient in parsing such files. It's good we can just drop it.
This commit is contained in:
parent
5411fb0cc6
commit
025157d597
2 changed files with 0 additions and 26 deletions
|
|
@ -234,29 +234,6 @@ read_client_id (const char *str)
|
|||
return nm_utils_hexstr2bin (s);
|
||||
}
|
||||
|
||||
GBytes *
|
||||
nm_dhcp_dhclient_get_client_id_from_config_file (const char *path)
|
||||
{
|
||||
gs_free char *contents = NULL;
|
||||
gs_strfreev char **lines = NULL;
|
||||
char **line;
|
||||
|
||||
g_return_val_if_fail (path != NULL, NULL);
|
||||
|
||||
if (!g_file_test (path, G_FILE_TEST_EXISTS))
|
||||
return NULL;
|
||||
|
||||
if (!g_file_get_contents (path, &contents, NULL, NULL))
|
||||
return NULL;
|
||||
|
||||
lines = g_strsplit_set (contents, "\n\r", 0);
|
||||
for (line = lines; lines && *line; line++) {
|
||||
if (!strncmp (*line, CLIENTID_TAG, NM_STRLEN (CLIENTID_TAG)))
|
||||
return read_client_id (*line);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
read_interface (const char *line, char *interface, guint size)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -43,7 +43,4 @@ gboolean nm_dhcp_dhclient_save_duid (const char *leasefile,
|
|||
const char *escaped_duid,
|
||||
GError **error);
|
||||
|
||||
GBytes *nm_dhcp_dhclient_get_client_id_from_config_file (const char *path);
|
||||
|
||||
#endif /* __NETWORKMANAGER_DHCP_DHCLIENT_UTILS_H__ */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue