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
This commit is contained in:
parent
4cfe5ad8b3
commit
f3897785f0
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user