From: Lennart Poettering Date: Mon, 24 Apr 2006 00:48:36 +0000 (+0000) Subject: filter out double DNS server entries X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=5be3898b65a4090f22de65751735138e6662f845;p=catta filter out double DNS server entries git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1195 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-dnsconfd/main.c b/avahi-dnsconfd/main.c index b384a03..dafa718 100644 --- a/avahi-dnsconfd/main.c +++ b/avahi-dnsconfd/main.c @@ -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