From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 9 16:43:32 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4AB6716A420 for ; Thu, 9 Mar 2006 16:43:32 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id A2A4043D46 for ; Thu, 9 Mar 2006 16:43:31 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.4) id k29GhTdI067882; Thu, 9 Mar 2006 10:43:29 -0600 (CST) (envelope-from dan) Date: Thu, 9 Mar 2006 10:43:29 -0600 From: Dan Nelson To: othermark Message-ID: <20060309164329.GD24511@dan.emsphone.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 5.5-PRERELEASE X-message-flag: Outlook Error User-Agent: Mutt/1.5.11 Cc: freebsd-hackers@freebsd.org Subject: Re: Advice on the lightweight resolver, lwres. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Mar 2006 16:43:32 -0000 In the last episode (Mar 09), othermark said: > 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: Are you running lwresd (the lwres lookup daemon)? Try trussing your program: socket(PF_INET,SOCK_DGRAM,17) = 3 (0x3) connect(3,{ AF_INET 127.0.0.1:921 },16) = 0 (0x0) According to the lwres manpage, lwresd needs to be running, and I'm guessing it would listen on UDP port 921. -- Dan Nelson dnelson@allantgroup.com