ndb/dns: handle empty $DNSSERVER
when $DNSSERVER is empty, query ndb for local dns servers instead of not using any at all.
This commit is contained in:
parent
c0280c607f
commit
e168ea045f
1 changed files with 2 additions and 3 deletions
|
@ -937,11 +937,9 @@ dnsservers(int class)
|
|||
return nsrp;
|
||||
|
||||
p = getenv("DNSSERVER"); /* list of ip addresses */
|
||||
if(p != nil){
|
||||
n = tokenize(p, args, nelem(args));
|
||||
if(p != nil && (n = tokenize(p, args, nelem(args))) > 0){
|
||||
for(i = 0; i < n; i++)
|
||||
addlocaldnsserver(dp, class, args[i], i);
|
||||
free(p);
|
||||
} else {
|
||||
t = lookupinfo("@dns"); /* @dns=ip1 @dns=ip2 ... */
|
||||
if(t == nil)
|
||||
|
@ -953,6 +951,7 @@ dnsservers(int class)
|
|||
}
|
||||
ndbfree(t);
|
||||
}
|
||||
free(p);
|
||||
|
||||
return rrlookup(dp, Tns, NOneg);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue