ref: ed888f3ee9ba746e76fe9aed0e2e6c1189ac45dd
parent: 784a9598880c119d8701db059bae956eacd5db72
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Oct 11 14:32:31 EDT 2018
ndb/dns: use nil for pointers in dnresolve() args
--- a/sys/src/cmd/ndb/dns.c
+++ b/sys/src/cmd/ndb/dns.c
@@ -771,11 +771,11 @@
/*
* dnsdebug calls
- * rr = dnresolve(buf, Cin, type, &req, 0, 0, Recurse, rooted, 0);
+ * rr = dnresolve(buf, Cin, type, &req, nil, 0, Recurse, rooted, nil);
* which generates a UDP query, which eventually calls
* dnserver(&reqmsg, &repmsg, &req, buf, rcode);
* which calls
- * rp = dnresolve(name, Cin, type, req, &mp->an, 0, recurse, 1, 0);
+ * rp = dnresolve(name, Cin, type, req, &mp->an, 0, recurse, 1, nil);
*
* but here we just call dnresolve directly.
*/
@@ -787,7 +787,7 @@
RR *rp, *neg;
status = Rok;
- rp = dnresolve(p, Cin, mf->type, req, 0, 0, Recurse, rooted, &status);
+ rp = dnresolve(p, Cin, mf->type, req, nil, 0, Recurse, rooted, &status);
neg = rrremneg(&rp);
if(neg){
--- a/sys/src/cmd/ndb/dnsdebug.c
+++ b/sys/src/cmd/ndb/dnsdebug.c
@@ -349,10 +349,10 @@
memset(&req, 0, sizeof req);
req.isslave = 1;
req.aborttime = NS2MS(nowns) + Maxreqtm;
- *l = dnresolve(rp->host->name, Cin, Ta, &req, 0, 0, Recurse, 0, 0);
+ *l = dnresolve(rp->host->name, Cin, Ta, &req, nil, 0, Recurse, 0, nil);
if(*l == nil)
*l = dnresolve(rp->host->name, Cin, Taaaa, &req,
- 0, 0, Recurse, 0, 0);
+ nil, 0, Recurse, 0, nil);
while(*l != nil)
l = &(*l)->next;
}
@@ -436,7 +436,7 @@
getactivity(&req, 0);
req.isslave = 1;
req.aborttime = NS2MS(nowns) + Maxreqtm;
- rr = dnresolve(buf, Cin, type, &req, 0, 0, Recurse, rooted, 0);
+ rr = dnresolve(buf, Cin, type, &req, nil, 0, Recurse, rooted, nil);
if(rr){
print("----------------------------\n");
for(rp = rr; rp; rp = rp->next)
--- a/sys/src/cmd/ndb/dnserver.c
+++ b/sys/src/cmd/ndb/dnserver.c
@@ -171,7 +171,7 @@
name = mp->qd->owner->name;
type = mp->qd->type;
- rp = dnresolve(name, Cin, type, req, &mp->an, 0, recurse, 1, 0);
+ rp = dnresolve(name, Cin, type, req, &mp->an, 0, recurse, 1, nil);
/* don't return soa hints as answers, it's wrong */
if(rp && rp->db && !rp->auth && rp->type == Tsoa) {
--- a/sys/src/cmd/ndb/dnsgetip.c
+++ b/sys/src/cmd/ndb/dnsgetip.c
@@ -38,7 +38,7 @@
req.isslave = 1;
req.aborttime = NS2MS(nowns) + Maxreqtm;
- rr = dnresolve(name, Cin, type, &req, 0, 0, Recurse, 0, &status);
+ rr = dnresolve(name, Cin, type, &req, nil, 0, Recurse, 0, &status);
neg = rrremneg(&rr);
if(rr == nil || neg != nil){
if(neg != nil)