The version of systemd-networkd in Kirkstone (v250) has a race where systemd-networkd may remove configs of unmanaged wlan interfaces on carrier loss. This bug is fixed in v251 of systemd by this commit: commit a0e99a377a2f22c0ba460d3e7228214008714c14 Author: Yu Watanabe <watanabe.yu+github@gmail.com> Date: Mon Jan 31 19:08:27 2022 +0900 network: remove only managed configs on reconfigure or carrier lost Otherwise, if the carrir of the non-managed interface is lost, the configs such as addresses or routes on the interface will be removed by networkd. I filed an upstream bug (https://github.com/systemd/systemd/issues/27910) which was closed as being "version-too-ancient". There are a lot of details in that upstream issue, but essentially when this bug is hit, the following is printed into the journal: 2023-05-30T20:20:36.939080-04:00 bar1071 systemd-networkd[1016]: wlp3s0: Lost carrier 2023-05-30T20:20:36.939338-04:00 bar1071 systemd-networkd[1016]: wlp3s0: Gained carrier 2023-05-30T20:20:36.939377-04:00 bar1071 systemd-networkd[1016]: wlp3s0: Unmanaging interface. 2023-05-30T20:20:36.943075-04:00 bar1071 systemd-networkd[1016]: wlp3s0: Connected WiFi access point: apname XX:XX:XX:XX:XX:XX) That "Unmanaging interface." is the indication that systemd-networkd has dropped the configuration (routes, IP addresses, etc) of the unmanaged wifi interface (in this case wlp3s0). The consequences of this are bad for a yocto firmware build which is likely headless and embedded. For any such device that depends on wifi for connectivity, hitting this bug causes network loss until the next time whatever tool is managing wifi (in our case NetworkManager) reconfigures (which is likely the next DHCP lease event, which may be days or weeks away depending on DHCP server configuration). Because Kirkstone is LTS I thought it best to log this bug here since upstream rejected it. AFAICT the most recent Kirkstone has this problem (definitely reproducible on 4.0.8 which is the version we are on right now). Also, FYI, this upstream commit cherry-picks cleanly onto v250.5, so I'm hoping its straightforward to simply take the upstream fix as a patch.
Can you send a patch to the list? If you're not familiar with the workflow, check out: https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded
Patch submitted to mailing list.
https://git.yoctoproject.org/poky/commit/?h=kirkstone&id=933033e54e4c0e1b5f2703c070c53fd5340c34c3