summary refs log tree commit diff
path: root/src/dhcp
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2017-02-16 00:00:34 +0100
committerMichael Biebl <biebl@debian.org>2017-02-16 00:00:34 +0100
commita222e56e103f949b148a6942e385ccca2c26d9f3 (patch)
tree7978165f4d291224c854adb4c96c863a924b4882 /src/dhcp
parent7f4dff3943c64e1d0e5d13b2ac915088dde165e6 (diff)
New upstream version 1.6.2 upstream/1.6.2
Diffstat (limited to 'src/dhcp')
-rw-r--r--src/dhcp/nm-dhcp-dhclient-utils.c4
-rw-r--r--src/dhcp/tests/test-dhcp-dhclient.c1
2 files changed, 5 insertions, 0 deletions
diff --git a/src/dhcp/nm-dhcp-dhclient-utils.c b/src/dhcp/nm-dhcp-dhclient-utils.c
index 8cc25ab5..f36451b2 100644
--- a/src/dhcp/nm-dhcp-dhclient-utils.c
+++ b/src/dhcp/nm-dhcp-dhclient-utils.c
@@ -245,6 +245,7 @@ nm_dhcp_dhclient_create_config (const char *interface,
 {
 	GString *new_contents;
 	GPtrArray *fqdn_opts, *reqs;
+	gboolean reset_reqlist = FALSE;
 	int i;
 
 	g_return_val_if_fail (!anycast_addr || nm_utils_hwaddr_valid (anycast_addr, ETH_ALEN), NULL);
@@ -302,6 +303,7 @@ nm_dhcp_dhclient_create_config (const char *interface,
 				in_req = TRUE;
 				p += strlen (REQ_TAG);
 				g_ptr_array_set_size (reqs, 0);
+				reset_reqlist = TRUE;
 			}
 
 			/* Save all request options for later use */
@@ -345,6 +347,8 @@ nm_dhcp_dhclient_create_config (const char *interface,
 		add_request (reqs, "ntp-servers");
 	}
 
+	if (reset_reqlist)
+		g_string_append (new_contents, "request; # override dhclient defaults\n");
 	/* And add it to the dhclient configuration */
 	for (i = 0; i < reqs->len; i++)
 		g_string_append_printf (new_contents, "also request %s;\n", (char *) reqs->pdata[i]);
diff --git a/src/dhcp/tests/test-dhcp-dhclient.c b/src/dhcp/tests/test-dhcp-dhclient.c
index 82f0c080..f4cf9c9f 100644
--- a/src/dhcp/tests/test-dhcp-dhclient.c
+++ b/src/dhcp/tests/test-dhcp-dhclient.c
@@ -511,6 +511,7 @@ static const char *existing_req_expected = \
 	"option ms-classless-static-routes code 249 = array of unsigned integer 8;\n"
 	"option wpad code 252 = string;\n"
 	"\n"
+	"request; # override dhclient defaults\n"
 	"also request another-thing;\n"
 	"also request yet-another-thing;\n"
 	"also request rfc3442-classless-static-routes;\n"