Looking through the code, the first sign of trouble is in dns_open() on line 504:
for (i = 0;i < myres.nscount;i++)
myres.nsaddr_list[i].sin_family = AF_INET;
resfd = socket(AF_INET, SOCK_DGRAM, 0);
Two assumptions that we will be dealing with v4 resolvers only.
Later, in dns_ack() on line 1253 we see more AF_INET used in comparing the response to make sure it was something we sent.
I presume handling DNS in this way was done so calls would be asynchronous. Could getaddrinfo_a() be employed instead to put some of the burden back on the system resolver library?
Looking through the code, the first sign of trouble is in dns_open() on line 504: nsaddr_ list[i] .sin_family = AF_INET;
for (i = 0;i < myres.nscount;i++)
myres.
resfd = socket(AF_INET, SOCK_DGRAM, 0);
Two assumptions that we will be dealing with v4 resolvers only.
Later, in dns_ack() on line 1253 we see more AF_INET used in comparing the response to make sure it was something we sent.
I presume handling DNS in this way was done so calls would be asynchronous. Could getaddrinfo_a() be employed instead to put some of the burden back on the system resolver library?