diff options
author | Thomas Haller <thaller@redhat.com> | 2018-10-24 15:23:24 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-11-13 19:09:33 +0100 |
commit | 025157d59729332f468b4ed8d2dcc77bce6d6397 (patch) | |
tree | cafeb748b39666382cff75ac2c90a4454f91fb65 | |
parent | 5411fb0cc68e3c3288f41c34976d4fd28b875682 (diff) | |
download | NetworkManager-025157d59729332f468b4ed8d2dcc77bce6d6397.tar.gz |
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.
-rw-r--r-- | src/dhcp/nm-dhcp-dhclient-utils.c | 23 | ||||
-rw-r--r-- | src/dhcp/nm-dhcp-dhclient-utils.h | 3 |
2 files changed, 0 insertions, 26 deletions
diff --git a/src/dhcp/nm-dhcp-dhclient-utils.c b/src/dhcp/nm-dhcp-dhclient-utils.c index b442e2ef75..fdfc2a408a 100644 --- a/src/dhcp/nm-dhcp-dhclient-utils.c +++ b/src/dhcp/nm-dhcp-dhclient-utils.c @@ -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) { diff --git a/src/dhcp/nm-dhcp-dhclient-utils.h b/src/dhcp/nm-dhcp-dhclient-utils.h index fab9196a3b..911fece488 100644 --- a/src/dhcp/nm-dhcp-dhclient-utils.h +++ b/src/dhcp/nm-dhcp-dhclient-utils.h @@ -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__ */ - |