Hi Dmitry, On Tue, Sep 29, 2015 at 08:08:51PM +0300, Dmitry Sivachenko wrote: > Hello, > > in case when machine has both A and AAAA records, there is an address > selection policy algorithm which determines which address to use first. > https://www.freebsd.org/cgi/man.cgi?query=ip6addrctl&sektion=8 > > I use it in "prefer ipv4" form, to use ipv4 first when available. > > All programs like ssh work as expected. > > In haproxy backends are resolved always to ipv6, even when there is an ipv4 > address. > > Is it possible to make it to respect address selection policy?
I *think* that getaddrinfo() provides this. You can try to build by adding USE_GETADDRINFO=1 to your makefile. It's not enabled by default because there are numerous bogus implementations on various systems. If it works for you it could be the best solution as other programs which work are likely using it. I don't know if it's safe to enable it by default on FreeBSD. Regards, Willy

