diff --git a/src/resolver.c b/src/resolver.c
index fbe4be7..c4adbc6 100644
--- a/src/resolver.c
+++ b/src/resolver.c
@@ -100,9 +100,9 @@ static int resolvfile_export(void)
* MAXDNSRCH/MAXNS entries are used.
*/
- for (count = 0, list = g_list_last(resolvfile_list);
+ for (count = 0, list = g_list_first(resolvfile_list);
list && (count < MAXDNSRCH);
- list = g_list_previous(list)) {
+ list = g_list_next(list)) {
struct resolvfile_entry *entry = list->data;
if (!entry->domain)
@@ -118,9 +118,9 @@ static int resolvfile_export(void)
if (count)
g_string_append_printf(content, "\n");
- for (count = 0, list = g_list_last(resolvfile_list);
+ for (count = 0, list = g_list_first(resolvfile_list);
list && (count < MAXNS);
- list = g_list_previous(list)) {
+ list = g_list_next(list)) {
struct resolvfile_entry *entry = list->data;
if (!entry->server)
--
2.7.4
________________________________________
From: connman <connman-bounces(a)lists.01.org> on behalf of Sam Nazarko
<email(a)samnazarko.co.uk>
Sent: 21 July 2016 18:37
To: connman(a)lists.01.org
Subject: [PATCH 0/1] Fix nameserver and search domain ordering when writing resolv.conf
Hi,
This patch fixes an issue where DNS servers and search domains are written to
resolv.conf in the reverse order. This has caused problems with some OSMC users that
have relied on the primary DNS server to be listed first and have a faulty or
intermittent
secondary DNS server. While I am in agreement that these users should fix their secondary
DNS server, we should still respect the ordering that they configure or get via DHCP.
I previously submitted a patch to this mailing list in hope of addressing an issue
however the ConnMan mailing list disappeared for a while and I lost my post. This
new patch resolves both search domains and DNS servers being out of order.
Sam Nazarko
_______________________________________________
connman mailing list
connman(a)lists.01.org
https://lists.01.org/mailman/listinfo/connman