From owner-svn-src-all@freebsd.org Wed Nov 4 19:09:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04E35A207DB; Wed, 4 Nov 2015 19:09:44 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C17101294; Wed, 4 Nov 2015 19:09:43 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA4J9gRw036548; Wed, 4 Nov 2015 19:09:42 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA4J9gIX036547; Wed, 4 Nov 2015 19:09:42 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201511041909.tA4J9gIX036547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Wed, 4 Nov 2015 19:09:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290372 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Nov 2015 19:09:44 -0000 Author: ume Date: Wed Nov 4 19:09:42 2015 New Revision: 290372 URL: https://svnweb.freebsd.org/changeset/base/290372 Log: Since sa->sa_len doesn't match sizeof(struct sockaddr_dl), getnameinfo() fails against sockaddr_dl. This commit is workaround for this problem. Modified: head/usr.bin/netstat/route.c Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Wed Nov 4 19:05:04 2015 (r290371) +++ head/usr.bin/netstat/route.c Wed Nov 4 19:09:42 2015 (r290372) @@ -527,6 +527,10 @@ routename(struct sockaddr *sa, int flags static char line[NI_MAXHOST]; int error, f; + /* XXX: sa->sa_len doesn't match sizeof(struct sockaddr_dl) */ + if (sa->sa_family == AF_LINK) + sa->sa_len = sizeof(struct sockaddr_dl); + f = (flags) ? NI_NUMERICHOST : 0; error = getnameinfo(sa, sa->sa_len, line, sizeof(line), NULL, 0, f);