Applying DNS TTL patch from #368.

I've restructured/cleaned up the original patch by thomas.other a bit.
This commit is contained in:
Robin Sommer 2011-06-25 17:41:51 -07:00
parent ded395007f
commit 6b9d23abb2
3 changed files with 34 additions and 6 deletions

View file

@ -438,6 +438,7 @@ nb_dns_activity(struct nb_dns_info *nd, struct nb_dns_result *nr, char *errstr)
register char **ap, **hap;
register u_int16_t id;
register const u_char *rdata;
register u_int32_t rttl;
register struct hostent *he;
register size_t rdlen;
ns_msg handle;
@ -557,6 +558,7 @@ nb_dns_activity(struct nb_dns_info *nd, struct nb_dns_result *nr, char *errstr)
rdata = ns_rr_rdata(rr);
rdlen = ns_rr_rdlen(rr);
rttl = ns_rr_ttl(rr);
switch (atype) {
case T_A:
@ -603,10 +605,12 @@ nb_dns_activity(struct nb_dns_info *nd, struct nb_dns_result *nr, char *errstr)
/* "Find first satisfactory answer" */
nr->hostent = he;
nr->ttl = rttl;
return (1);
}
}
nr->hostent = he;
nr->ttl = rttl;
return (1);
}