Bug 183148 - [patch] add getaddrinfo(1) tool from NetBSD
Summary: [patch] add getaddrinfo(1) tool from NetBSD
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 1.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: Eric van Gyzen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-21 08:20 UTC by Ronald S. Storey
Modified: 2017-03-28 13:40 UTC (History)
2 users (show)

See Also:


Attachments
getaddrinfo.1.diff (4.99 KB, patch)
2013-10-21 08:20 UTC, Ronald S. Storey
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ronald S. Storey 2013-10-21 08:20:00 UTC
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
Comment 1 Hiren Panchasara freebsd_committer freebsd_triage 2017-01-09 07:55:04 UTC
Is this still valid/useful?
Comment 2 Eric van Gyzen freebsd_committer freebsd_triage 2017-01-09 15:38:35 UTC
I have wanted a tool like this a few times over the years.  This should still be considered.
Comment 3 Lohith Bellad 2017-01-09 17:29:12 UTC
I will adapt the patch to HEAD and test it.

Thanks,
Lohith
Comment 4 Lohith Bellad 2017-01-27 07:36:41 UTC
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
Comment 5 Eric van Gyzen freebsd_committer freebsd_triage 2017-01-27 14:01:25 UTC
(In reply to Lohith Bellad from comment #4)

Did you intend to attach a new patch with your comment?
Comment 6 Lohith Bellad 2017-01-28 06:14:55 UTC
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
Comment 7 Eric van Gyzen freebsd_committer freebsd_triage 2017-03-28 01:33:24 UTC
Committed to head as r315640.  (I forgot to mention the PR in the commit.)
Comment 8 commit-hook freebsd_committer freebsd_triage 2017-03-28 13:39:45 UTC
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