Off-Topic > Off-Topic - Tiny Core Lounge
iwlist scan shows non-existent hotspot
GNUser:
Best solution would be to figure out where iwlist keeps its cache, so that I can flush it before scanning.
Rich:
Hi GNUser
From the man page:
--- Quote ---scan[ning]
Give the list of Access Points and Ad-Hoc cells in range, and optionally a whole bunch of information about them (ESSID, Quality, Frequency, Mode...). The type of information returned depends on what the card supports.
Triggering scanning is a privileged operation (root only) and normal users can only read left-over scan results. By default, the way scanning is done (the scope of the scan) is dependant on the card and card settings.
This command take optional arguments, however most drivers will ignore those. The option essid is used to specify a scan on a specific ESSID. The option last do not trigger a scan and read left-over scan results.
--- End quote ---
Notice what the last sentence says:
--- Quote ---The option last do not trigger a scan and read left-over scan results.
--- End quote ---
Try adding another option after scan.
GNUser:
--- Code: ---$ iwlist --help
Usage: iwlist [interface] scanning [essid NNN] [last]
--- End code ---
I think it means that if the option last (literal) is used, then no scan is performed and results come 100% from cache.
I'm not using the last option.
It seems that if last is omitted, then scan results include those of an actual scan plus what's in the cache.
There must be a way to either ignore the cache or else to flush it before scanning...
GNUser:
I can confirm that adding the option last results in only cached results being shown.
Running strace does not reveal an obvious cache file:
--- Code: ---$ strace -e trace=file iwlist wlan0 scanning last
execve("/usr/local/sbin/iwlist", ["iwlist", "wlan0", "scanning", "last"], [/* 27 vars */]) = 0
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/local/lib/libiw.so.29", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
wlan0 Scan completed :
Cell 01 - Address: 00:E1:6D:63:57:47
Channel:1
Frequency:2.412 GHz (Channel 1)
Quality=53/70 Signal level=-57 dBm
Encryption key:off
ESSID:"WorkVisitor"
Bit Rates:5.5 Mb/s; 6 Mb/s; 9 Mb/s; 11 Mb/s; 12 Mb/s
18 Mb/s; 24 Mb/s; 36 Mb/s
Bit Rates:48 Mb/s; 54 Mb/s
Mode:Master
Extra:tsf=000003a70067d7f9
Extra: Last beacon: 752737ms ago
IE: Unknown: 000B41524D4356697369746F72
IE: Unknown: 01088B0C129618243048
IE: Unknown: 030101
IE: Unknown: 0706555320010B1E
IE: Unknown: 0B0505005E8D5B
IE: Unknown: 2A0100
IE: Unknown: 2D1A2C181BFFFF000000000000000000000000000000000000000000
IE: Unknown: 3202606C
IE: Unknown: 3D1601000500000000000000000000000000000000000000
IE: Unknown: 7F080010000001400001
IE: Unknown: 851E09008F000F00FF0359004C41502D41432D322D303600000000000500003A
IE: Unknown: 9606004096000800
IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F00
IE: Unknown: DD06004096010104
IE: Unknown: DD050040960305
IE: Unknown: DD050040960B09
IE: Unknown: DD080040961301003401
IE: Unknown: DD050040961404
+++ exited with 0 +++
--- End code ---
Where are the cached results hiding? If I can find them, then maybe I can flush them.
Rich:
Hi GNUser
--- Quote from: GNUser on May 27, 2020, 02:15:59 PM ---
--- Code: ---$ iwlist --help
Usage: iwlist [interface] scanning [essid NNN] [last]
--- End code ---
I think it means that if the option last (literal) is used, then no scan is performed and results come 100% from cache.
I'm not using the last option.
It seems that if last is omitted, then scan results include those of an actual scan plus what's in the cache. ...
--- End quote ---
Seems they forgot to list that in the man pages Synopsis. The word last showed up exactly one time in the man page.
Maybe do a search for something you can change (scan, iwlist, cache, wlan, etc.) in sysctl:
--- Code: ---sudo sysctl -a 2>&1 | grep -i wlan
--- End code ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version