From: Simon Budig Date: Tue, 10 Mar 2009 13:56:52 +0000 (+0100) Subject: don't conflict with answers with ttl 0. X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8ca143139a1b62677d13b47957457e3831a6b35b;hp=a3e3305d8dc52c13b46be5f5c08f7c829517fe0d;p=mdnsd.git don't conflict with answers with ttl 0. --- diff --git a/mdnsd.c b/mdnsd.c index 6f134e0..e640a6d 100644 --- 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;jnscount;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); } }