From 01253f8ec8e5d7e5a6d1d392ff526ccd56fcc5dc Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Mon, 21 Mar 2011 13:25:57 -0300 Subject: dhcp: do not overwrite DNS servers The counter 'i' was not being incremented, making secondary DNS servers to overwrite the first ones. --- src/dhcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dhcp.c b/src/dhcp.c index 6fda67d9..58198288 100644 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -167,7 +167,7 @@ static void lease_available_cb(GDHCPClient *dhcp_client, gpointer user_data) ns_entries += 1; dhcp->nameservers = g_try_new0(char *, ns_entries + 1); if (dhcp->nameservers) { - for (i = 0, list = option; list; list = list->next) + for (i = 0, list = option; list; list = list->next, i++) dhcp->nameservers[i] = g_strdup(list->data); dhcp->nameservers[ns_entries] = NULL; } -- cgit v1.2.3