summary refs log tree commit diff
path: root/src/dhcp/nm-dhcp-dhclient-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dhcp/nm-dhcp-dhclient-utils.c')
-rw-r--r--src/dhcp/nm-dhcp-dhclient-utils.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/src/dhcp/nm-dhcp-dhclient-utils.c b/src/dhcp/nm-dhcp-dhclient-utils.c
index d8f8dd98..3290dd65 100644
--- a/src/dhcp/nm-dhcp-dhclient-utils.c
+++ b/src/dhcp/nm-dhcp-dhclient-utils.c
@@ -316,7 +316,6 @@ nm_dhcp_dhclient_create_config (const char *interface,
 
 	if (orig_contents) {
 		char **lines, **line;
-		int nest = 0;
 		gboolean in_alsoreq = FALSE;
 		gboolean in_req = FALSE;
 		char intf[IFNAMSIZ];
@@ -331,23 +330,17 @@ nm_dhcp_dhclient_create_config (const char *interface,
 			if (!strlen (g_strstrip (p)))
 				continue;
 
-			if (in_req) {
-				/* pass */
-			} else if (strchr (p, '{')) {
-				nest++;
-				if (   !intf[0]
-				    && g_str_has_prefix (p, "interface"))
-					if (read_interface (p, intf, sizeof (intf)))
-						continue;
-			} else if (strchr (p, '}')) {
-				if (nest)
-					nest--;
-				intf[0] = '\0';
-				continue;
+			if (   !intf[0]
+			    && g_str_has_prefix (p, "interface")
+			    && !in_req) {
+				if (read_interface (p, intf, sizeof (intf)))
+					continue;
 			}
 
-			if (nest && !intf[0])
+			if (intf[0] && strchr (p, '}')) {
+				intf[0] = '\0';
 				continue;
+			}
 
 			if (intf[0] && !nm_streq (intf, interface))
 				continue;
@@ -530,10 +523,6 @@ nm_dhcp_dhclient_unescape_duid (const char *duid)
 	guint i, len;
 	guint8 octal;
 
-	/* FIXME: it's wrong to have an "unescape-duid" function. dhclient
-	 * defines a file format with escaping. So we need a general unescape
-	 * function that can handle dhclient syntax. */
-
 	len = strlen (duid);
 	unescaped = g_byte_array_sized_new (len);
 	for (i = 0; i < len; i++) {
@@ -547,9 +536,6 @@ nm_dhcp_dhclient_unescape_duid (const char *duid)
 				g_byte_array_append (unescaped, &octal, 1);
 				i += 2;
 			} else {
-				/* FIXME: don't warn on untrusted data. Either signal an error, or accept
-				 * it silently. */
-
 				/* One of ", ', $, `, \, |, or & */
 				g_warn_if_fail (p[i] == '"' || p[i] == '\'' || p[i] == '$' ||
 				                p[i] == '`' || p[i] == '\\' || p[i] == '|' ||