]> git.meshlink.io Git - catta/commitdiff
filter out double DNS server entries
authorLennart Poettering <lennart@poettering.net>
Mon, 24 Apr 2006 00:48:36 +0000 (00:48 +0000)
committerLennart Poettering <lennart@poettering.net>
Mon, 24 Apr 2006 00:48:36 +0000 (00:48 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1195 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-dnsconfd/main.c

index b384a038e0df19196c76cf40a7d2f702afec1435..dafa718b5cfecc410716a8f6217ed2104505faee 100644 (file)
@@ -202,8 +202,18 @@ static char *concat_dns_servers(AvahiIfIndex interface) {
     
     for (i = servers; i; i = i->servers_next)
         if (i->interface == interface || interface <= 0) {
+            DNSServerInfo *j;
             char *t;
 
+            /* Filter out double entries */
+            for (j = servers; j != i; j = j->servers_next)
+                if (j->interface == interface || interface <= 0)
+                    if (strcmp(i->address, j->address) == 0)
+                        break;
+
+            if (j != i)
+                continue;
+            
             if (!r)
                 t = avahi_strdup(i->address);
             else