RPi-Distro / raspi-config

Configuration tool for the Raspberry Pi
Other
565 stars 207 forks source link

Issues when multiple wireless interfaces are available #161

Closed jcapona closed 1 year ago

jcapona commented 3 years ago

Issue

Most of the wifi operations performed in raspi-config only consider the first interface that the function list_wlan_interfaces reports... e.g.: https://github.com/RPi-Distro/raspi-config/blob/5b11405bf839083557ec64c263fc79165e01c3cd/raspi-config#L518

If there's more than one wireless interface available, this might introduce issues, specially if the other interface gets reported before the integrated wireless card by list_wlan_interfaces and it's not managed by wpa_supplicant.

Also, since lxplug-network uses raspi-config to determine the wifi country, the icon will report issues. Don't know if any other part of the OS is affected by this.

Example

If an interface is called ap0, list_wlan_interfaces will report ap0 wlan0... since only the first one of the list is used, all the operations performed in raspi-config use ap0.

If the interface isn't managed by wpa_supplicant, all operations that run wpa_cli will fail even though the other interface wlan0 is reported and it's probably the one raspi-config wants to use

If ap0 is renamed so that it appears after wlan0 (e.g.: to wlan_ap0 or something like that), this issue disappears since wlan0 is used.

Proposal

Instead of reporting all available wlan interfaces, filter those interfaces to determine only the ones controlled by wpa_supplicant so the functions in raspi-config can work as expected.