Bug 167798 - ifconfig(8): problem with "ifconfig list scan" command in ad-hoc mode
Summary: ifconfig(8): problem with "ifconfig list scan" command in ad-hoc mode
Status: Closed Works As Intended
Alias: None
Product: Base System
Classification: Unclassified
Component: wireless (show other bugs)
Version: 9.0-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-wireless (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-11 15:00 UTC by Johann Hugo
Modified: 2019-01-26 11:16 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johann Hugo 2012-05-11 15:00:27 UTC
The "ifconfig list scan" command does not work in adhoc mode if the channel was manually set with "ifconfig wlanX channel Y" 

It only works if the channel was not configured.

How-To-Repeat: ifconfig wlan0 create wlandev ath0 wlanmode adhoc
ifconfig wlan0 bssid 66:98:40:46:b7:0a up
ifconfig wlan0 list scan
SSID/MESH ID    BSSID              CHAN RATE   S:N     INT CAPS
meraka          0a:02:6f:8b:b6:93   11   54M -91:-96  100 EPS  WME RSN ATH
CSIR Guest      06:02:6f:8b:b6:93   11   54M -90:-96  100 ES   WME ATH

------------------------------------------------------------------
Now lock the channel, after that "list scan" gives no more output.
------------------------------------------------------------------
ifconfig wlan0 down
ifconfig wlan0 channel 13 up
ifconfig wlan0 list scan

------------------------------------------------------------------
Remove the channel selection and it works again
------------------------------------------------------------------
ifconfig wlan0 down
ifconfig wlan0 channel -
ifconfig wlan0 up
mesh-2aee:~ # ifconfig wlan0 list scan
SSID/MESH ID    BSSID              CHAN RATE   S:N     INT CAPS
CSIR Wireless   00:02:6f:8b:b6:93   11   54M -89:-96  100 EPS  WME RSN ATH
CSIR Guest      06:02:6f:8b:b6:93   11   54M -90:-96  100 ES   WME ATH
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2012-05-11 17:26:25 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-wireless

fix synopsis and assign
Comment 2 Johann Hugo 2012-05-25 11:14:42 UTC
I found a way to get it to work with the channel that was manually set
and I can get it to stop stop working again.

------------------------------------------------------------------
Configure adapter (no output):
------------------------------------------------------------------
mesh-284f:~ # ifconfig wlan0 channel 13 ssid test bssid 66:98:40:46:b7:0a up
mesh-284f:~ # ifconfig wlan0 list scan

------------------------------------------------------------------
Get it to work:
------------------------------------------------------------------
mesh-284f:~ # ifconfig wlan0 channel -; ifconfig wlan0 channel 13
mesh-284f:~ # ifconfig wlan0 list scan
SSID/MESH ID    BSSID              CHAN RATE   S:N     INT CAPS
meraka          0a:02:6f:8b:b6:93   11   54M -86:-96  100 EPS  WME RSN ATH
CSIR Guest      06:02:6f:8b:b6:93   11   54M -86:-96  100 ES   WME ATH
CSIR Wireless   00:02:6f:8b:b6:93   11   54M -87:-96  100 EPS  WME RSN ATH
eduroam         0e:02:6f:8b:b6:93   11   54M -87:-96  100 EPS  WME RSN ATH

------------------------------------------------------------------
Get it to stop working (no output):
------------------------------------------------------------------
mesh-284f:~ # ifconfig wlan0 down; ifconfig wlan0 up
mesh-284f:~ # ifconfig wlan0 list scan
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2018-05-28 19:50:30 UTC
batch change:

For bugs that match the following
-  Status Is In progress 
AND
- Untouched since 2018-01-01.
AND
- Affects Base System OR Documentation

DO:

Reset to open status.


Note:
I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
Comment 4 Andriy Voskoboinyk freebsd_committer freebsd_triage 2019-01-26 11:16:25 UTC
That's how it should work - see description of 'chanlist' and 'channel' ifconfig(8) parameters.

Since the NIC is locked to the particular channel and there are no other wlans on this channel nearby the scan list is empty.

The 'list scan' displays scan results that were cached from the previous scan; since 'ifconfig wlan0 channel -' removes limitations and new scan is triggered the cache will be non-empty - that's why the workaround 'works'.