Bug 215301 - ifconfig list scan still abbreviates some SSID in -v mode
Summary: ifconfig list scan still abbreviates some SSID in -v mode
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: wireless (show other bugs)
Version: 11.0-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: Andriy Voskoboinyk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-14 12:43 UTC by Markus Stoff
Modified: 2016-12-18 21:08 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Stoff 2016-12-14 12:43:39 UTC
A SSID with the maximum length of 32 characters will be abbreviated by "list scan", even when in verbose mode (using "-v" switch) (BSSID changed for privacy):

> ifconfig -v wlan0 list scan
SSID/MESH ID                     BSSID              CHAN RATE    S:N     INT
DIRECT-88-HP DeskJet 3630 se...  fc:3f:db:ff:ff:ff    1   54M  -87:-95   100


This is because list_scan() assumes the maximum SSID length (ssidmax) to be "IEEE80211_NWID_LEN - 1" in verbose mode. Changing this to "IEEE80211_NWID_LEN" will lead to the expected behavior of displaying the full SSID:

> ifconfig -v wlan0 list scan
SSID/MESH ID                      BSSID              CHAN RATE    S:N     INT
DIRECT-88-HP DeskJet 3630 series  fc:3f:db:ff:ff:ff    1   54M  -87:-95   100


This change should be safe, as the "ssid" variable, which is used to store that value, is already initialized with the correct size (IEEE80211_NWID_LEN+1).

Here is a unified diff with my suggested fix:

--- sbin/ifconfig/ifieee80211.c.orig    2016-12-14 13:12:15.883264000 +0100
+++ sbin/ifconfig/ifieee80211.c 2016-12-14 13:12:36.495865000 +0100
@@ -3311,7 +3311,7 @@
 
        getchaninfo(s);
 
-       ssidmax = verbose ? IEEE80211_NWID_LEN - 1: 14;
+       ssidmax = verbose ? IEEE80211_NWID_LEN: 14;
        printf("%-*.*s  %-17.17s  %4s %4s   %-7s  %3s %4s\n"
                , ssidmax, ssidmax, "SSID/MESH ID"
                , "BSSID"
Comment 1 commit-hook freebsd_committer freebsd_triage 2016-12-14 21:13:02 UTC
A commit references this bug:

Author: avos
Date: Wed Dec 14 21:12:43 UTC 2016
New revision: 310089
URL: https://svnweb.freebsd.org/changeset/base/310089

Log:
  ifconfig: do not truncate SSID in verbose mode.

  Fix 32-character SSID abbreviation for 'ifconfig -v wlan0 scan' command.

  PR:		215301
  Submitted by:	<ms-freebsd-bugzilla@stoffnet.at>
  MFC after:	4 days

Changes:
  head/sbin/ifconfig/ifieee80211.c
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-12-18 21:00:38 UTC
A commit references this bug:

Author: avos
Date: Sun Dec 18 20:59:24 UTC 2016
New revision: 310235
URL: https://svnweb.freebsd.org/changeset/base/310235

Log:
  MFC r310089:
  ifconfig: do not truncate SSID in verbose mode.

  Fix 32-character SSID abbreviation for 'ifconfig -v wlan0 scan' command.

  PR:		215301
  Submitted by:	<ms-freebsd-bugzilla@stoffnet.at>

Changes:
_U  stable/11/
  stable/11/sbin/ifconfig/ifieee80211.c
Comment 3 Andriy Voskoboinyk freebsd_committer freebsd_triage 2016-12-18 21:08:59 UTC
Committed, thanks!