Solaris IPv6 DNS and http_proxy segfault
I just built dillo on Solaris 9 and I encountered a few issues compiling and running it. I didn't see any mention of these in the bug entries or the list archives, but I'll admit I didn't look for very long, so if any of these have already been dealt with, I apologize. Dillo won't compile on Solaris 9 (and probably earlier versions too) with IPv6 enabled. In dns.c it calls gethostbyname2() for IPv6 name resolution; this function doesn't exist in Solaris, it should use getipnodebyname() or getaddrinfo(). I edited dns.c and replaced the gethostbyname2() call with a call to getipnodebyname(). The diff follows: --- src/dns-dist.c Sun Jul 6 23:29:05 2003 +++ src/dns.c Sun Jul 6 23:33:08 2003 @@ -244,6 +244,7 @@ memcpy(&dh->data[0], host->h_addr_list[i], host->h_length); list = g_slist_append(list, dh); } + freehostent(host); return list; } @@ -260,6 +261,7 @@ struct hostent sh; #endif GSList *hosts = NULL; + int err_num; #ifdef G_DNS_THREADED /* Set this thread to detached state */ @@ -271,9 +273,14 @@ #ifdef ENABLE_IPV6 if (ipv6_enabled) { - host = gethostbyname2(dns_server[channel].hostname, AF_INET6); + host = getipnodebyname(dns_server[channel].hostname, AF_INET6, AI_DEFAULT, &err_num) if (host) - hosts = Dns_note_hosts(hosts, AF_INET6, host); + { + if (host->h_length == 4) + hosts = Dns_note_hosts(hosts, AF_INET, host); + else + hosts = Dns_note_hosts(hosts, AF_INET6, host); + } } #endif This works okay for me, but I'm not a programmer, so it's fairly sloppy, probably introduces new bugs, and could certainly be improved upon. I'm particularly unsure if that's the right place for the freehostent(), or if that's necessary at all. The other issue I ran into was that Dillo will apparently segfault, at least on my system, if the http_proxy environment variable is set and contains only a hostname and port rather than a full URL. Here's the console output: Setting locale to C... dillo_dns_init: Here we go! Cookies: Created file: /home/tc/.dillo/cookies Enabling cookies as from cookiesrc... Nav_open_url: Url=>about:splash< Nav_open_url: Url=>http://dillo.auriga.wearlab.de/< Dns_server [0]: is 0 zsh: segmentation fault (core dumped) dillo Again, I'm sorry if these have already been brought up, and I hope I've been somewhat helpful if they haven't. -- Todd Carson | tc@telerama.com | GPG: CA8E1FCB ~ Ubi dubium, ibi libertas. ~
participants (1)
-
Todd Carson