experchange > redhat

William Unruh (07-19-19, 10:58 PM)
iwlist, which is used in Mageia, and in wicd, has a severe disability--
namely if there are too many access points like more than 200 or so, it
reports nothing. This means that on Mageia, the networking simply does
not work when there are too may. Thus, DeGalle airport, Taipei airport,
Heathrow airport, the Radcliffe hospitel in Oxford, and sometimes the
physics dept at Univ of BC ( and probably other universities) are
unuseble for any wireless program that uses iwlist.
iw does work ( with at least up to 500 access points-- I have not found
a location with more than that many APs.
And this is becoming more and more of a problem since many people have
set up their phones to act as access points.

But sureley others have run into this limitation on other programs as
well.

Does Network Manager use iwlist to find the access points? Does it cease
to work in the case of some of the above locations?

How have others gotten around this limitation of iwlist? Or is there
some way of upping the number of APs that iwlist can handle? If so, how?

I cannot believe that I am the only one in the world that has run into
this limitation.
HASM (07-19-19, 11:32 PM)
> iwlist, which is used in Mageia, and in wicd, has a severe disability--
> namely if there are too many access points like more than 200 or so, it
> reports nothing.


Yes, one is not supposed to used iwlist anymore. Instead of, e,g,
iwlist wlan0
use
iw dev wlan0 scan

It should work for all cards that support nl80211, for older ones that
don't, you're stuck with iwlist and you may need to rebuild it with
this patch:


-- HASM
William Unruh (07-20-19, 10:48 AM)
On 2019-07-19, HASM <hasm> wrote:
> Yes, one is not supposed to used iwlist anymore. Instead of, e,g,
> iwlist wlan0
> use
> iw dev wlan0 scan


iw has a totally diffeent output from iwlist, and is NOT a replacement
for iwlist. They also have for over 10 years had a disclaimer that you
are not to assume that iw is at all usefull for scripting as they retain
the right to totally change the output without a by-your-leave. And as
far as i can see, no user useful wireless program uses iw, rather than
iwlist. (Please tell me I am wrong if I am and which one uses iw).

> It should work for all cards that support nl80211, for older ones that
> don't, you're stuck with iwlist and you may need to rebuild it with
> this patch:
>


Thanks a lot for the pointer to this patch.

Unfortunately it does not work. The newer iwlist.c (I have version 30
for wireless-tools) already includes this
patch, but iwlist still does NOT print out the list of APs it has found
before it ran out of room. Ie, the claim that this patch solves the
problem is false.
HASM (07-20-19, 04:45 PM)
> iw has a totally diffeent output from iwlist, and is NOT a replacement
> for iwlist.


Maybe, but it's scan command overcomes iwlist's limitation of the number
of access points.

I'm not advocating one or the other, and don't know the history behind
either, but wireless-tools, of which iwlist is a part of, hasn't been
updated since 2007, while iw seems to have recent changes.

> They also have for over 10 years had a disclaimer that you are not to
> assume that iw is at all usefull for scripting as they retain the
> right to totally change the output


But have they? (I don't know the answer). You can always download the
source, recompile it, rename it or tuck it away in some non default
place, then use it for your scripts.

> And as far as i can see, no user useful wireless program uses iw,
> rather than iwlist. (Please tell me I am wrong if I am and which one
> uses iw).


On my Fedora system
/etc/sysconfig/network-scripts/ifup-wireless
/etc/sysconfig/network-scripts/network-functions
use iw, while
/etc/sysconfig/network-scripts/ifdown-eth
uses iwconfig :-). Not for listing, though.

I don't run NetworkManager to give it a try (or maybe I do in an old
laptop that isn't accessible now). If you do you could try

nmcli dev wifi list

-- HASM
William Unruh (07-20-19, 05:38 PM)
On 2019-07-20, HASM <hasm> wrote:
>> iw has a totally diffeent output from iwlist, and is NOT a replacement
>> for iwlist.

> Maybe, but it's scan command overcomes iwlist's limitation of the number
> of access points.


Yes, it does. I know that. That is how I dicovered that when iwlist
gives nothing at all, it is because there are over 200 access points (as
seen by iw)

> I'm not advocating one or the other, and don't know the history behind
> either, but wireless-tools, of which iwlist is a part of, hasn't been
> updated since 2007, while iw seems to have recent changes.


Actually not correct, but also not too far out.
-rw-r----- 1 unruh unruh 62089 Nov 24 2009 iwlist.c

>> They also have for over 10 years had a disclaimer that you are not to
>> assume that iw is at all usefull for scripting as they retain the
>> right to totally change the output

> But have they? (I don't know the answer). You can always download the
> source, recompile it, rename it or tuck it away in some non default
> place, then use it for your scripts.


It is the distributions that need to use it for their scripts (Network
Center, Network Manager, wicd,.....)

>> And as far as i can see, no user useful wireless program uses iw,
>> rather than iwlist. (Please tell me I am wrong if I am and which one
>> uses iw).

> On my Fedora system
> /etc/sysconfig/network-scripts/ifup-wireless


It uses iwlist I believe if it uses any listing function, which I do not
think it does..
[..]
HASM (07-21-19, 07:01 PM)
William Unruh <unruh> writes:

me> but wireless-tools, of which iwlist is a part of, hasn't been
me> updated since 2007, while iw seems to have recent changes.

wu> Actually not correct, but also not too far out.
wu> -rw-r----- 1 unruh unruh 62089 Nov 24 2009 iwlist.c

Fedora ships v29, the last official release, which is from 2007. Ubuntu
ships v30-beta, from 2009, which never became official.

This page sums it up:



Curiously, one of the comments to the first answer claims:

The reason Ubuntu (and pretty much all distros I know of) provide
version 30 beta is because that version fixes a critical bug that was
in version 29, which caused the iwconfig to fail if there were too
many networks in the area due to a buffer overflow. The Github repo
for wireless tools does not show this, but here's the relevant patch
from Arch

Thus they claim that fixes your problem, though I guess it does not.

-- HASM
William Unruh (07-21-19, 09:28 PM)
On 2019-07-21, HASM <hasm> wrote:
[..]
> for wireless tools does not show this, but here's the relevant patch
> from Arch
> Thus they claim that fixes your problem, though I guess it does not.


wireless-tools-30-0.pre9.10.mga6

The source code shows the test for buffer length which is in those
patches. But iwlist scan shows nothing if there are too many APs.
William Unruh (07-22-19, 09:13 PM)
On 2019-07-21, HASM <hasm> wrote:
[..]
> for wireless tools does not show this, but here's the relevant patch
> from Arch
> Thus they claim that fixes your problem, though I guess it does not.


So the problem that this seems to fix is that of the buffer overflow (or
at least the buffer length be larer than the max length that the integer
(short) the buffer can be be shorter than the buffer length). However
it would seem that if the ioctl need a longer buffer that 65535 then
wither it puts nothing into the buffer or iwlist prints nothing out. I
am not sure which it is. What would seem sensible is if the ioctl filled
up the buffer with as much as it can, and iwlist printed it out. You
would loose some of the output, but you would still get a lot of APs
listed.

Does anyone know which it is? Ie, is the buffer full of information and
iwlist just does not print it out, or is that that the buffer is
actually empty, because the ioctl refused to put in any information.
Now, what I am using is ctl80211 and mac80211 (not the old Wireless
extention) modules. Is it they that are misbehaving?
HASM (07-23-19, 12:11 AM)
> Does anyone know which it is? Ie, is the buffer full of information and
> iwlist just does not print it out, or is that that the buffer is
> actually empty, because the ioctl refused to put in any information.


I faced this problem twice, same place, at a relative's apartment, back
in Europe. Can't remember whether I applied the patch the first time,
but the second time I'm sure I used iw. Not even sure where to go
around "here" to even test this.

> Now, what I am using is ctl80211 and mac80211 (not the old Wireless
> extention) modules. Is it they that are misbehaving?


Or this.

-- HASM
Similar Threads