ndb/dns: refuse recursive requests harder when given -R (thanks be0ba)

Before we would refuse to recurse, but would still give
a response with hints back. Some nefarious clients will interpret the
lack of a Refused response code as us being an open resolver.
This commit is contained in:
Jacob Moody 2024-08-31 02:23:05 +00:00
parent 761452154a
commit 9d2f21b2cf

View file

@ -65,7 +65,8 @@ dnserver(DNSmsg *reqp, DNSmsg *repp, Request *req, uchar *srcip, int rcode)
if(cfg.nonrecursive
|| cfg.localrecursive && !localip(srcip)){
/* we don't recurse and we're not authoritative */
neg = nil;
setercode(repp, Rrefused);
return;
} else {
repp->flags |= Fcanrec;
if(reqp->flags & Frecurse){