In the case of hotplug event of a "net" device (eg. USB Ethernet adapter), the /etc/udev/scripts/network.sh script is called. This script should configure the ethernet interface by calling ifup/ifdown. (the ifup/ifdown call is done at the end of the script) Due to missing /etc/network/options file (and its content) and/or a service (udev_network_queue.sh ?) using /dev/udev_network_queue to initialize the network interfaces, the network.sh script exits early. I commented out the spoofing part of the script, and everything seems to work as intended. I didn't try a cold boot with the USB adapter present, though (which seemed to be addressed by the extra code in the script long ago). I could find traces of the arrival of the problem about 14 years ago, but it still seems present in the latest yocto (I personally found it in dunfell and petalinux 2023/langdale). The recipe responsible for the network.sh script is udev-extraconf.
https://layers.openembedded.org/layerindex/recipe/629/ https://git.openembedded.org/openembedded-core/tree/meta/recipes-core/udev/udev-extraconf_1.1.bb?h=master Would you be able to send a patch? First it should be applied to master and then can be backported as needed.
Created attachment 5074 [details] Allow udev script to configure hotplugged ethernet interfaces The script was doing nothing at all. After the modification, it does the initialization of the ethernet interfaces, but the removed parts had warnings about security issue if the action was done too early (boot time). My opinion is that the job is done anyway somewhere else, and it does not seem so dangerous vs the intended feature is not working.
Regis, Are you able to send the patch to the oe-core email list? That's where it can be reviewed.
https://lists.openembedded.org/g/openembedded-core/message/206032
Merged: https://git.openembedded.org/openembedded-core/commit/?id=160f7139172ffdf510a0d7d4e85f7fbaac7fd000 Thanks Régis !