[PATCH] scan: Solve the problem of garbled characters in the scanned ssid
Johannes Berg
johannes at sipsolutions.net
Fri Oct 29 00:10:04 PDT 2021
On Fri, 2021-10-29 at 15:07 +0800, 王鑫鹏 wrote:
> > > On Fri, 2021-10-29 at 14:40 +0800, xinpeng.wang wrote:
> > > Using Netgear WN11V2 usb wireless network card, it is easy to have
> > > garbled characters i
> > > n the scanned ssid. This is because the driver sends the problem
> > > packets to wpa through
> > > netlink. These packets are only partly seen through wireshark, but
> > > the missing parts when
> > > sent to wpa are some random values, which may cause the read ssid
> > > to be garbled.
> > > In the update scan res, check whether the sum of the length of
> > > each ie in ies is the same
> > > as ie_len. If it is not the same, it is considered to be abnormal
> > > packet and discard it.
>
> > > Seems like something the *driver* should do?
>
> thank you for your reply.
>
> I think the driver should be able to ensure that what is passed to wpa
> is correct, but wpa
> should also be able to filter these packets and not be affected by
> these abnormal packets.
I'm not sure I agree. If we wanted to put workarounds for all hardware
bugs into wpa_supplicant, that'd probably end up quite a mess. Such
things are better handled by the specific driver.
Clearly wpa_supplicant needs to ensure its own consistency isn't
damaged, e.g. that it doesn't crash on malformed (perhaps maliciously
so) frames, but as long as the frame is just garbage, IMHO the driver
should do such things.
Note also that in this particular instance, I believe you're now
dropping beacon frames that don't have completely well-formed elements,
which is very well known to cause problems.
johannes
More information about the Hostap
mailing list