ndb/dnstcp: return a proper non-answer when rejecting zone transfer

This commit is contained in:
cinap_lenrek 2018-10-09 06:34:27 +02:00
parent 08292c8f1f
commit e73ce8475e

View file

@ -299,15 +299,15 @@ dnzone(DNSmsg *reqp, DNSmsg *repp, Request *req, uchar *srcip)
/* send the soa */
repp->an = rrlookup(dp, Tsoa, NOneg);
reply(1, repp, req);
if(repp->an == nil)
goto out;
if(!anyone && !myip(srcip) && findserver(srcip, repp->an->soa->slaves, req) == nil){
if(repp->an != nil && !anyone && !myip(srcip)
&& findserver(srcip, repp->an->soa->slaves, req) == nil){
dnslog("dnstcp: %I axfr %s - not a dnsslave", srcip, dp->name);
rrfreelist(repp->an);
repp->an = nil;
goto out;
}
reply(1, repp, req);
if(repp->an == nil)
goto out;
rrfreelist(repp->an);
repp->an = nil;