udev-builtin-net_id: add NAMING_DEVICETREE_PORT_ALIASES to check of_node of netdevs...
authorMatthias Schiffer <matthias.schiffer@ew.tq-group.com>
Wed, 7 Aug 2024 10:01:24 +0000 (12:01 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 15 Aug 2024 16:20:49 +0000 (18:20 +0200)
commit24c2e04e9a3b53bc8a57ac4a7a89d8da8e4feb72
treed40c8c995b4294a98ff01d3873025e7f8d711dbc
parent98b86d294adcca9887d0676190e7f697f45f7f54
udev-builtin-net_id: add NAMING_DEVICETREE_PORT_ALIASES to check of_node of netdevs before their parents

The net_id builtin only checked the of_node of a netdev's parent device,
not that of the netdev itself. While it is common that netdevs don't have
an OF node assigned themselves, as they are derived from some parent
device, this is not always the case. In particular when a single
controller provides multiple ports that can be referenced indiviually in
the Device Tree (both for aliases/MAC address assignment and phandle
references), the correct of_node will be that of the netdev itself, not
that of the parent, so it needs to be checked, too.

A new naming scheme flag NAMING_DEVICETREE_PORT_ALIASES is added to
allow selecting the new behavior.
man/systemd.net-naming-scheme.xml
src/shared/netif-naming-scheme.h
src/udev/udev-builtin-net_id.c