[ldns-users] ldns_resolver_set_ip6() and ldns_resolver_query() leads to SIGSEGV
Matthijs Mekking
matthijs at NLnetLabs.nl
Tue Feb 16 09:28:39 UTC 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
I fixed this in ldns trunk. In these cases, ldns will now return a "No
(valid) nameservers" error.
Best regards,
Matthijs
Zbynek Michl wrote:
> Hello,
>
> when I read resolver addresses from /etc/resolv.conf where are only IPv4
> addresses and set IPv6 resolvers preference to LDNS_RESOLV_INET6, then
> ldns_resolver_query() calling causes a crash.
>
> My /etc/resolv.conf:
>
> nameserver 127.0.0.1
> nameserver 172.20.20.40
>
>
> Sample code:
>
> /* create a new resolver from /etc/resolv.conf */
> s = ldns_resolver_new_frm_file(&res, NULL);
>
> if (s != LDNS_STATUS_OK) {
> exit(EXIT_FAILURE);
> }
>
> /* set IPv6 resolver preference */
> ldns_resolver_set_ip6(res, LDNS_RESOLV_INET6);
>
> /* use the resolver to send a query for the mx
> * records of the domain given on the command line
> */
> p = ldns_resolver_query(res, domain, LDNS_RR_TYPE_MX, LDNS_RR_CLASS_IN,
> LDNS_RD);
>
>
> When I compile it and run, on ldns_resolver_query() calling program
> crashes (Segmentation fault).
>
> The same failure occurs when I set IPv4 preference and resolv.conf
> contains only IPv6 addresses.
>
>
> gdb backtrace:
>
> Program received signal SIGSEGV, Segmentation fault.
> ldns_pkt_tc (packet=0x0) at packet.c:58
> 58 {
> (gdb) bt
> #0 ldns_pkt_tc (packet=0x0) at packet.c:58
> #1 0x00007ffff73d3072 in ldns_resolver_send_pkt (answer=0x7fffffffe200,
> r=0x602290, query_pkt=0x602070) at resolver.c:968
> #2 0x00007ffff73d3246 in ldns_resolver_send (answer=0x7fffffffe268,
> r=0x602290, name=0x602010, t=LDNS_RR_TYPE_MX,
> c=LDNS_RR_CLASS_IN, flags=8) at resolver.c:1090
> #3 0x00007ffff73d3308 in ldns_resolver_query (r=0x602290,
> name=0x602010, t=LDNS_RR_TYPE_MX, c=LDNS_RR_CLASS_IN, flags=8)
> at resolver.c:908
>
>
> Regards,
> Zbynek
> _______________________________________________
> ldns-users mailing list
> ldns-users at open.nlnetlabs.nl
> http://open.nlnetlabs.nl/mailman/listinfo/ldns-users
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iQEcBAEBAgAGBQJLemVGAAoJEA8yVCPsQCW5OBIIAJuENc9vuMop2XQ7tIDKlkSA
SN8+OKj1fRas5oYLjb2Y48c5M8JVpyaOO2u+laf7AGxO37Wd5v7k9zX/toPhq7Qj
cerGe7JVS4dlr12V5OAqLnJSXDzArUmy2cGKSjfN2mPjkNyzkNeKlmB9QjkEnc08
uqPjP33W7BN6kgpkEMBdqz/O9+KRvwpRgVll4wOL+pElN9RkJvADDcSb8RHZv6ko
eQsCP9aOFumST7u42urgZOPNwZkeAW5Dw0TwEWqbBUhNAqtEXmJgrTaoqu95FN6k
HJszmKhopZPXCglsDCL1nAwjd9prTDIm9strOrFuzHUcbV5h5Xe03/COv9T7CT8=
=Qk/4
-----END PGP SIGNATURE-----
More information about the ldns-users
mailing list