On 26/02/2010 00:52, Shawn Walker wrote:
On 02/25/10 06:03 PM, Robert Milkowski wrote:
Hi,
mi...@vault:~$ cat dns.c
#include<stdlib.h>
#include<sys/types.h>
#include<netinet/in.h>
#include<arpa/nameser.h>
#include<resolv.h>
#include<netdb.h>
int main(int argc, char **argv)
{
res_init();
if (!_res.nscount) {
fprintf(stderr,"No nameservers defined.\n");
exit(1);
}
}
mi...@vault:~$ gcc -o dns -lresolv -lsocket -lnsl dns.c
...
it works fine on b111 but fails on b132 and b133 (I haven't tested
any other builds).
Did you check _res.res_h_errno? I would note that res_init() is
deprecated.
If an error is encountered during res_init()'s initial logic, it will
effectively set nscount to 0 because it sets maxns = 0. [1]
well, _res.res_h_errno is returning with 0 while nscount is 0 as well.
deprecated or not that's what some programs are using (like mtr) and
something changed post 111b so it stopped working.
I could get mtr fixed but really the problem has to be founded as it
might impact other programs too.
Will try to dig more deeply once I've got some time.
--
Robert Milkowski
http://milek.blogspot.com
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code