Page MenuHomeFreeBSD

ifconfig(8): scan list SSID UTF-32 support
Needs ReviewPublic

Authored by enweiwu on Oct 20 2022, 3:10 PM.
Referenced Files
Unknown Object (File)
Jan 11 2024, 3:53 PM
Unknown Object (File)
Dec 24 2023, 2:40 PM
Unknown Object (File)
Dec 22 2023, 11:09 PM
Unknown Object (File)
Nov 7 2023, 11:41 PM
Unknown Object (File)
Oct 6 2023, 10:24 PM
Unknown Object (File)
Oct 4 2023, 10:31 PM
Unknown Object (File)
Oct 4 2023, 10:23 PM
Unknown Object (File)
Sep 30 2023, 10:22 PM

Details

Reviewers
lwhsu
bz
adrian
cy
Summary

Below is the planned commit message:

ifconfig(8): scan list SSID UTF-32 support

    Originally, if SSID exist characters are not printable ASCII but is printable in UTF-32 (many language, for e.g. Chinese), they will be printed as hex. Fix it by turning normal character to wide character (wchar_t) and verify whether a wide character is printable by iswprint(). This is just a little hack and is not elegant. Maybe we can store SSID in wchar_t in the begining of ifconfig(8)?
Test Plan

We can make use of wtap(4) for simulating 802.11 device:

Load wtap.ko

Goto sys/modules/wtap, and load wtap.ko (may need the priority of super user):

kldload ./wtap.ko

Create two parent wlan devices wtap0, wtap1

Goto tools/tools/wtap/wtap, and follow the commands below (may need the priority of super user) :

./wtap c 0
./wtap c 1

Create two child wlan devices (vap) wlan0, wlan1 in IBSS mode

Follow the commands below (may need the priority of super user) :

ifconfig wlan0 create wlandev wtap0 wlanmode adhoc
ifconfig wlan1 create wlandev wtap1 wlanmode adhoc ssid <SSID you want to test>

Use visibility tool to enable communications between wlan0 and wlan1

Goto tools/tools/wtap/vis_map, and follow the commands below (may need the priority of super user) :

./vis_map o
./vis_map a 0 1
./vis_map a 1 0

SSID scan test

Bring up wlan0, wlan1:

ifconfig wlan0 up
ifconfig wlan1 up

Correctly setup locale:

export LC_ALL=<your locale>

Then perform scanning, and see whether the output is desired:

ifconfig wlan0 scan

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

enweiwu edited the test plan for this revision. (Show Details)
In D37070#841801, @bz wrote:

Hi, Bjoern,

Sorry for not seeing the diff D32847 before I made this diff. So we cannot assume that SSID is encoded in UTF-8, and we shall check bit 48 (SSID is UTF-8 encoded) in Extended Capabilities element (127, IEEE80211_ELEMID_EXTCAP).

But I have noticed this comment in D32847:

To my surprise, while most frames did contain extended capabilities, none of them indicated that SSID is UTF-8 encoded (while it really was) and one AP with non-Latin UTF-8 SSID did not send any EXPCAP element.

So the question seems to be very tricky...