From owner-freebsd-net Fri Aug 10 7:39: 1 2001 Delivered-To: freebsd-net@freebsd.org Received: from ringworld.nanolink.com (sentinel.office1.bg [217.75.135.254]) by hub.freebsd.org (Postfix) with SMTP id A69EB37B405 for ; Fri, 10 Aug 2001 07:38:55 -0700 (PDT) (envelope-from roam@ringworld.nanolink.com) Received: (qmail 35412 invoked by uid 1000); 10 Aug 2001 14:37:31 -0000 Date: Fri, 10 Aug 2001 17:37:31 +0300 From: Peter Pentchev To: Maxim Konovalov Cc: net@FreeBSD.ORG Subject: Re: getaddrinfo() returning AF_INET only? Message-ID: <20010810173731.E14158@ringworld.oblivion.bg> References: <20010810163757.B14158@ringworld.oblivion.bg> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from maxim@macomnet.ru on Fri, Aug 10, 2001 at 06:25:10PM +0400 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Fri, Aug 10, 2001 at 06:25:10PM +0400, Maxim Konovalov wrote: > > Hello, > > > Hi, > > > > Is there a configuration file or environment variable or some other > > way to make getaddrinfo(3) not return AF_INET6 addresses even if > > those are available? I know that most utilities that use > > I believe you are speaking about > > struct addrinfo hint.ai_family = PF_INET; If I am writing my own utility which needs to do hostname resolution, then yes, ai_family is what I need. However, there are lots of ready-made utilities out there that I do not want to modify the source for, I just do not want them to use IPv6 addresses for the present. As I said, most of them already can do this with a command-line option, but it seems that there is no program-independent way to tell the resolver libraries to do it. > > getaddrinfo(3) have an IPv4-only command-line option, but is there a > > way to turn it on globally? > > resolver(3) mentions RES_OPTIONS Yep - and neither resolver(3), nor the src/lib/libc/net/getaddrinfo.c source (specifically, the _dns_getaddrinfo() function) seem to describe/implement a resolver option that forbids AAAA queries. G'luck, Peter -- This sentence would be seven words long if it were six words shorter. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message