From 5be3898b65a4090f22de65751735138e6662f845 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 24 Apr 2006 00:48:36 +0000 Subject: [PATCH] filter out double DNS server entries git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1195 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-dnsconfd/main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 -- 2.39.5