Date: Thu, 09 Mar 2006 08:23:24 -0800 From: othermark <atkin901@yahoo.com> To: freebsd-hackers@freebsd.org Subject: Advice on the lightweight resolver, lwres. Message-ID: <dupkpt$u7q$1@sea.gmane.org>
next in thread | raw e-mail | index | archive | help
I was working on converting the STAF (staf.sourceforge.net) project to an freebsd port, and on my first attempt, I attempted to use the lightweight resolver library because of the thread safe functions _r() that were available. However once I finished a straight port, I found, that lwres_gethostbyname() always returns 61 (connection refused). Nothing ever shows up on tcpdump on any interface (yes, even lo0). Of course, just changing the netdb include and compiling without lwres works. example of slightly modified code from the staf project: #include <lwres/netdb.h> #include <errno.h> #include <stdio.h> #define HERROR -1 int main(void) { char buffer[256]; struct hostent *host; if (gethostname(buffer, sizeof(buffer)) == HERROR) { fprintf(stderr,"Error getting hostname: gethostname() RC=%d\n", errno); return errno; } host = gethostbyname(buffer); if (host == 0) { fprintf(stderr,"Error getting hostent structure: gethostbyname() RC=%d\n",errno); return errno; } return 0; } $ gcc -o lwres-test lwres-test.c -llwres $ ./lwres-test Error getting hostent structure: gethostbyname() RC=61 -- othermark atkin901 at nospam dot yahoo dot com (!wired)?(coffee++):(wired);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?dupkpt$u7q$1>