]> git.karo-electronics.de Git - mdnsd.git/commitdiff
don't conflict with answers with ttl 0.
authorSimon Budig <simon@budig.de>
Tue, 10 Mar 2009 13:56:52 +0000 (14:56 +0100)
committerOle Reinhardt <ole.reinhardt@kernelconcepts.de>
Sun, 28 Apr 2013 23:02:35 +0000 (01:02 +0200)
mdnsd.c

diff --git a/mdnsd.c b/mdnsd.c
index 6f134e0e6d0aff163d7c3f517320c8bdf13976b5..e640a6dac389eefee82307dd2702d992e65ca2a8 100644 (file)
--- a/mdnsd.c
+++ b/mdnsd.c
@@ -528,7 +528,7 @@ void mdnsd_in(mdnsd d, struct message *m, unsigned long int ip, unsigned short i
                 { // probing state, check for conflicts
                     for(j=0;j<m->nscount;j++)
                     { // check all to-be answers against our own
-                        if(m->qd[i].type != m->an[j].type || strcasecmp(m->qd[i].name,m->an[j].name)) continue;
+                        if(m->an[j].ttl == 0 || m->qd[i].type != m->an[j].type || strcasecmp(m->qd[i].name,m->an[j].name)) continue;
                         if(!_a_match(&m->an[j],&r->rr))
                             may_conflict = 1;
                         else
@@ -569,7 +569,7 @@ void mdnsd_in(mdnsd d, struct message *m, unsigned long int ip, unsigned short i
           {
             while ((r = _r_next(d,r,m->an[i].name,m->an[i].type)) != 0)
               {
-                if (r->unique && _a_match(&m->an[i],&r->rr) == 0)
+                if (r->unique && _a_match(&m->an[i],&r->rr) == 0 && m->an[i].ttl > 0)
                   _conflict(d, r);
               }
           }