WDS stopped working in 21.02, looking for bug in netifd, BUG FOUND!

Daniel Haid d.haid at gogi.tv
Thu Sep 23 15:54:34 PDT 2021

Hi everyone, I think I finally located the problem!

There is a race condition between hostapd and netifd.

In hostapd, src/drivers/driver_nl80211.c, look at the function 
i802_set_wds_sta. There are calls to

1) nl80211_create_iface and
2) linux_br_add_if.

Now call 1) seems to trigger netifd into calling

3) bridge_hotplug_add from bridge.c in netifd.

Now the problem is whether 2) or 3) is called first.

If 2) is called first, it succeeds, and hostapd continues with WDS mode 
as required -> GOOD CASE, connection works.

If 3) is called first, then 2) fails which leads i802_set_wds_sta to 
return immediately without doing what it should do -> BAD CASE, 
connection does not work.


More information about the openwrt-devel mailing list