From owner-svn-src-head@FreeBSD.ORG Fri Jun 7 08:06:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C8B5E3D2; Fri, 7 Jun 2013 08:06:48 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BB7A81F22; Fri, 7 Jun 2013 08:06:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5786m2u011996; Fri, 7 Jun 2013 08:06:48 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5786m5m011995; Fri, 7 Jun 2013 08:06:48 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201306070806.r5786m5m011995@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 7 Jun 2013 08:06:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251486 - head/usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jun 2013 08:06:48 -0000 Author: ae Date: Fri Jun 7 08:06:48 2013 New Revision: 251486 URL: http://svnweb.freebsd.org/changeset/base/251486 Log: Use getnameinfo(3) instead of inet_ntop(3) to make printable versions of sockaddr_in6 structures. getnameinfo(3) does the same thing, but it is also able to represent a scope zone id as described in the RFC 4007. MFC after: 2 weeks Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Fri Jun 7 07:17:46 2013 (r251485) +++ head/usr.bin/kdump/kdump.c Fri Jun 7 08:06:48 2013 (r251486) @@ -74,6 +74,7 @@ extern int errno; #include #include #include +#include #include #include #include @@ -1531,7 +1532,8 @@ ktrsockaddr(struct sockaddr *sa) memset(&sa_in6, 0, sizeof(sa_in6)); memcpy(&sa_in6, sa, sa->sa_len); check_sockaddr_len(in6); - inet_ntop(AF_INET6, &sa_in6.sin6_addr, addr, sizeof addr); + getnameinfo((struct sockaddr *)&sa_in6, sizeof(sa_in6), + addr, sizeof(addr), NULL, 0, NI_NUMERICHOST); printf("[%s]:%u", addr, htons(sa_in6.sin6_port)); break; }