Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Aug 2001 17:37:31 +0300
From:      Peter Pentchev <roam@ringlet.net>
To:        Maxim Konovalov <maxim@macomnet.ru>
Cc:        net@FreeBSD.ORG
Subject:   Re: getaddrinfo() returning AF_INET only?
Message-ID:  <20010810173731.E14158@ringworld.oblivion.bg>
In-Reply-To: <Pine.BSF.4.33.0108101819260.82870-100000@news1.macomnet.ru>; from maxim@macomnet.ru on Fri, Aug 10, 2001 at 06:25:10PM %2B0400
References:  <20010810163757.B14158@ringworld.oblivion.bg> <Pine.BSF.4.33.0108101819260.82870-100000@news1.macomnet.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010810173731.E14158>