[systemd-devel] udev breaks hostap linkage of raw/user interfaces, causing wpa_supplicant problems

David Herrmann dh.herrmann at gmail.com
Mon Mar 16 09:25:54 PDT 2015


On Mon, Mar 16, 2015 at 4:48 PM, Thomas Richter <thor at math.tu-berlin.de> wrote:
> If udev comes into play, it renames wlan0 to wlan1, because wlan0 was
> already taken from a previously installed ipw2200 card that is no longer
> in the system. Hence, I have now the network interfaces wifi0 and wlan1,
> and that confuses wpa_supplicant to an amount that it can no longer
> authenticate the connection. Why precisely that is the case I do not
> know, but naming both interfaces the same resolves the problem.

Ok, forget my previous mail, your issue is only related to the wext
driver, not the hostap extensions.

Up front, upstream udev never renames wlan0 to wlan1. This is a
downstream problem.

The problem is the following:
Kernel hostap creates both, wlan%d and wifi%d net-devs. wpa_supplicant
doesn't know which is in use and therefore sets wifi%d as secondary
ifindex for any wlan%d device. That is, if wlan5 is probed and wifi5
exists, it adds wifi5 as secondary index to wlan5 (see
wpa_driver_wext_finish_drv_init() in hostap/src/driver_wext.c). This
is for compatibility with legacy drivers. It is not needed today and
should be dropped.
Now if wlan5 *and* wifi5 exist, but are not related, things will go wrong.

On the kernel side, hostap creates one netdev on device initialization
(wifi%d in prism2_init_local_data()), and one after probing is done
(wlan%d in hostap_hw_ready()). Both pass "%d" to the networking core,
which means, the suffix is allocated dynamically! On both names! If
you have more than one wireless card, there is no guarantee at all
that the suffix IDs will be identical for wlan%d and wifi%d. The
assumption wpa_supplicant places on the kernel-names is just wrong.

The first netdev-renaming-scheme in udev used to save udev-rules to
make wlan%d names consistent. This was soon considered broken and
deprecated. Upstream udev hasn't shipped this for quite a long time.

I recommend fixing the netdev-renaming rules in debian or telling the
wpa_supplicant developers, that those netdev suffixes are not stable
at all. Or update to systemd-udevd.


More information about the systemd-devel mailing list