From: Remy Bohmer Date: Sat, 29 Oct 2011 19:10:22 +0200 Subject: [PATCH] Merge DNS search tables between IPv4 and IPv6 Without this patch the IPv4 search tables will be overwritten once an IPv6 domain is added. With this patch both tables will be merged. Signed-off-by: Bart vdr. Meulen Signed-off-by: Remy Bohmer --- Port-linux/lowlevel-options-linux.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Port-linux/lowlevel-options-linux.c b/Port-linux/lowlevel-options-linux.c index d5be379..929b24b 100644 --- a/Port-linux/lowlevel-options-linux.c +++ b/Port-linux/lowlevel-options-linux.c @@ -199,11 +199,14 @@ int domain_add(const char* ifname, int ifaceid, const char* domain) { return LOWLEVEL_ERROR_FILE; while (fgets(buf,511,f)) { if ( (!found) && (strstr(buf, "search")) ) { - if (strlen(buf)) - buf[strlen(buf)-1]=0; - fprintf(f2, "%s %s\n", buf, domain); - found = 1; - continue; + if (!strstr(buf,domain)) { + if (strlen(buf)) + buf[strlen(buf)-1]=0; + fprintf(f2, "%s %s\n", buf, domain); + found = 1; + continue; + } + } fprintf(f2,"%s",buf); }