Bug 15616 - network.sh udev script not configuring hotplugged interfaces
Summary: network.sh udev script not configuring hotplugged interfaces
Status: RESOLVED FIXED
Alias: None
Product: Meta-yocto
Classification: Build System, Metadata & Runtime
Component: meta-yocto (show other bugs)
Version: unspecified
Hardware: All Multiple
: Medium normal
Target Milestone: 5.2
Assignee: Régis Dargent
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2024-10-10 08:23 UTC by Régis Dargent
Modified: 2024-10-31 15:00 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments
Allow udev script to configure hotplugged ethernet interfaces (1.73 KB, patch)
2024-10-10 15:49 UTC, Régis Dargent
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Régis Dargent 2024-10-10 08:23:12 UTC
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.
Comment 1 Tim Orling 2024-10-10 15:00:56 UTC
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.
Comment 2 Régis Dargent 2024-10-10 15:49:07 UTC
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.
Comment 3 Randy MacLeod 2024-10-17 15:13:46 UTC
Regis, Are you able to send the patch to the oe-core email list?
That's where it can be reviewed.