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.

(cherry picked from commit 025157d597)
This commit is contained in:
Thomas Haller 2018-10-24 15:23:24 +02:00
parent a6095fd043
commit 981a54024b
2 changed files with 0 additions and 26 deletions

View file

@ -233,29 +233,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)
{

View file

@ -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__ */