Add an utility to diagnose getaddrinfo() and nsswitch.conf issues where drill(1) doesn't help. Fix: Before applying the patch $ export CVSROOT=anoncvs@anoncvs.NetBSD.org:/cvsroot $ cvs co src/lib/libutil $ cvs co src/usr.bin/getaddrinfo $ cp src/lib/libutil/sockaddr_snprintf.c /usr/src/lib/libnetbsd/ $ cp -R src/usr.bin/getaddrinfo /usr/src/usr.bin/ $ svn add /usr/src/lib/libnetbsd/sockaddr_snprintf.c /usr/src/usr.bin/ How-To-Repeat: $ getaddrinfo -c -t stream -s 80 wiki.freebsd.org canonname wfe0.ysv.freebsd.org stream inet6 tcp 2001:1900:2254:206a::50:0 80 stream inet tcp 8.8.178.110 80
Is this still valid/useful?
I have wanted a tool like this a few times over the years. This should still be considered.
I will adapt the patch to HEAD and test it. Thanks, Lohith
Adopted the patch to FreeBSD. Made little change to getaddrinfo Makefile based on new LIBADD framework. getaddrinfo utility is working as expected on FreeBSD Head. Thanks, Lohith
(In reply to Lohith Bellad from comment #4) Did you intend to attach a new patch with your comment?
Sorry about not uploading the latest DIFF. I have raised the review for the same and here is the differential, https://reviews.freebsd.org/D9365 Thanks, Lohith
Committed to head as r315640. (I forgot to mention the PR in the commit.)
A commit references this bug: Author: vangyzen Date: Tue Mar 28 13:39:05 UTC 2017 New revision: 316098 URL: https://svnweb.freebsd.org/changeset/base/316098 Log: MFC r315640 Port the getaddrinfo(1) utility from NetBSD. PR: 183148 Submitted by: Lohith Bellad <lohithbsd@gmail.com> Obtained from: NetBSD Relnotes: yes Sponsored by: Dell EMC Changes: _U stable/11/ stable/11/lib/libnetbsd/Makefile stable/11/lib/libnetbsd/sockaddr_snprintf.c stable/11/lib/libnetbsd/util.h stable/11/usr.bin/Makefile stable/11/usr.bin/getaddrinfo/ stable/11/usr.bin/getaddrinfo/getaddrinfo.1