]> git.ipfire.org Git - thirdparty/systemd.git/commit
udev: allow/denylist for reading sysfs attributes when composing a NIC name
authorLukas Nykryn <lnykryn@redhat.com>
Fri, 8 Dec 2023 11:33:06 +0000 (12:33 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 19 Dec 2023 10:15:52 +0000 (19:15 +0900)
commit3b2e7dc5a285edbbb1bf6aed2d88b889d801613f
tree3dcda000313d0fb0b09d67fe9ba44150ba0ca270
parent91436851d5a658820560adf74510ce8ceef06199
udev: allow/denylist for reading sysfs attributes when composing a NIC name

Users can currently pick specific versions of NIC naming, but that
does not guarantee that NIC names won't change after the kernel adds
a new sysfs attribute.

This patch allows for an allow/deny list of sysfs attributes
that could be used when composing the name.

These lists can be supplied as an hwdb entry in the form of
/etc/udev/hwdb.d/50-net-naming-allowlist.hwdb
net:naming:drvirtio_net
  ID_NET_NAME_ALLOW=0
  ID_NET_NAME_ALLOW_ACPI_INDEX=1
  ID_NET_NAME_ALLOW_ADDR_ASSIGN_TYPE=1
  ID_NET_NAME_ALLOW_ADDRESS=1
  ID_NET_NAME_ALLOW_ARI_ENABLED=1
  ID_NET_NAME_ALLOW_DEV_PORT=1
  ID_NET_NAME_ALLOW_FUNCTION_ID=1
  ID_NET_NAME_ALLOW_IFLINK=1
  ID_NET_NAME_ALLOW_INDEX=1
  ID_NET_NAME_ALLOW_LABEL=1
  ID_NET_NAME_ALLOW_PHYS_PORT_NAME=1
  ID_NET_NAME_ALLOW_TYPE=1
man/systemd.net-naming-scheme.xml
rules.d/75-net-description.rules
src/shared/netif-naming-scheme.c
src/shared/netif-naming-scheme.h
src/udev/udev-builtin-net_id.c