From owner-svn-src-head@freebsd.org Fri Aug 4 21:06:48 2017 Return-Path: Delivered-To: svn-src-head@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 CD31DDC8F4D; Fri, 4 Aug 2017 21:06:48 +0000 (UTC) (envelope-from mjoras@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 9AA587C326; Fri, 4 Aug 2017 21:06:48 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v74L6l5i034689; Fri, 4 Aug 2017 21:06:47 GMT (envelope-from mjoras@FreeBSD.org) Received: (from mjoras@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v74L6lwo034688; Fri, 4 Aug 2017 21:06:47 GMT (envelope-from mjoras@FreeBSD.org) Message-Id: <201708042106.v74L6lwo034688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjoras set sender to mjoras@FreeBSD.org using -f From: Matt Joras Date: Fri, 4 Aug 2017 21:06:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322062 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: mjoras X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 322062 X-SVN-Commit-Repository: base 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.23 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, 04 Aug 2017 21:06:48 -0000 Author: mjoras Date: Fri Aug 4 21:06:47 2017 New Revision: 322062 URL: https://svnweb.freebsd.org/changeset/base/322062 Log: Selectively print "hwaddr" from ifconfig(8). ifconfig(8) printing the hwaddr is only really useful if it differs from the link layer address. Reported by: jhb Reviewed by: rpokala Approved by: rstone (mentor) Differential Revision: https://reviews.freebsd.org/D11777 Modified: head/sbin/ifconfig/af_link.c Modified: head/sbin/ifconfig/af_link.c ============================================================================== --- head/sbin/ifconfig/af_link.c Fri Aug 4 20:24:23 2017 (r322061) +++ head/sbin/ifconfig/af_link.c Fri Aug 4 21:06:47 2017 (r322062) @@ -108,7 +108,15 @@ link_status(int s __unused, const struct ifaddrs *ifa) if (rc != 0) { return; } - if (memcmp(ifr.ifr_addr.sa_data, laggaddr, sdl->sdl_alen) == 0) { + + /* + * If this is definitely a lagg device or the hwaddr + * matches the link addr, don't bother. + */ + if (memcmp(ifr.ifr_addr.sa_data, laggaddr, + sdl->sdl_alen) == 0 || + memcmp(ifr.ifr_addr.sa_data, LLADDR(sdl), + sdl->sdl_alen) == 0) { return; } ether_format = ether_ntoa((const struct ether_addr *)