From owner-svn-src-all@freebsd.org Sat Aug 11 10:21:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66AFB1065DA1; Sat, 11 Aug 2018 10:21:22 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A3BB74F99; Sat, 11 Aug 2018 10:21:22 +0000 (UTC) (envelope-from sevan@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFB8515C1A; Sat, 11 Aug 2018 10:21:21 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BALLAC025579; Sat, 11 Aug 2018 10:21:21 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BALL6L025578; Sat, 11 Aug 2018 10:21:21 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201808111021.w7BALL6L025578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Sat, 11 Aug 2018 10:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337614 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 337614 X-SVN-Commit-Repository: base 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.27 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: Sat, 11 Aug 2018 10:21:22 -0000 Author: sevan (doc committer) Date: Sat Aug 11 10:21:21 2018 New Revision: 337614 URL: https://svnweb.freebsd.org/changeset/base/337614 Log: Drop the ternary operator for calculating ssid display length in list_scan(). Regardless if a verbose scan is required or not, we'd still want to display the full SSID name by default so use the IEE80211_NWID_LEN constant to set the value to use instead. Tested on rene@'s laptop. Reviewed by: kp Sponsored by: Essen Hackathon Differential Revision: https://reviews.freebsd.org/D16566 Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Sat Aug 11 09:32:20 2018 (r337613) +++ head/sbin/ifconfig/ifieee80211.c Sat Aug 11 10:21:21 2018 (r337614) @@ -3496,7 +3496,7 @@ list_scan(int s) uint8_t buf[24*1024]; char ssid[IEEE80211_NWID_LEN+1]; const uint8_t *cp; - int len, ssidmax, idlen; + int len, idlen; if (get80211len(s, IEEE80211_IOC_SCAN_RESULTS, buf, sizeof(buf), &len) < 0) errx(1, "unable to get scan results"); @@ -3505,9 +3505,8 @@ list_scan(int s) getchaninfo(s); - ssidmax = verbose ? IEEE80211_NWID_LEN : 32; printf("%-*.*s %-17.17s %4s %4s %-7s %3s %4s\n" - , ssidmax, ssidmax, "SSID/MESH ID" + , IEEE80211_NWID_LEN, IEEE80211_NWID_LEN, "SSID/MESH ID" , "BSSID" , "CHAN" , "RATE" @@ -3530,8 +3529,8 @@ list_scan(int s) idlen = sr->isr_ssid_len; } printf("%-*.*s %s %3d %3dM %4d:%-4d %4d %-4.4s" - , ssidmax - , copy_essid(ssid, ssidmax, idp, idlen) + , IEE80211_NWID_LEN + , copy_essid(ssid, IEE80211_NWID_LEN, idp, idlen) , ssid , ether_ntoa((const struct ether_addr *) sr->isr_bssid) , ieee80211_mhz2ieee(sr->isr_freq, sr->isr_flags)