summaryrefslogtreecommitdiffstats
path: root/src/shared/netif-naming-scheme.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* udev: allow onboard index up to 65535Viktor Mihajlovski2021-04-291-1/+2
| | | | | | | | | | The maximum allowed value of the sysfs device index entry was limited to 16383 (2^14-1) to avoid the generation of unreasonable onboard interface names. For s390 the index can assume a value of up to 65535 (2^16-1) which is now allowed depending on the new naming flag NAMING_16BIT_INDEX. Larger index values are considered unreasonable and remain to be ignored.
* udev: fix slot based network names on s390Viktor Mihajlovski2021-04-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The s390 PCI driver assigns the hotplug slot name from the function_id attribute of the PCI device using a 8 char hexadecimal format to match the underlying firmware/hypervisor notation. Further, there's always a one-to-one mapping between a PCI function and a hotplug slot, as individual functions can hot plugged even for multi-function devices. As the generic matching code will always try to parse the slot name in /sys/bus/pci/slots as a positive decimal number, either a wrong value might be produced for ID_NET_NAME_SLOT if the slot name consists of decimal numbers only, or none at all if a character in the range from 'a' to 'f' is encountered. Additionally, the generic code assumes that two interfaces share a hotplug slot, if they differ only in the function part of the PCI address. E.g., for an interface with the PCI address dddd:bb:aa.f, it will match the device to the first slot with an address dddd:bb:aa. As more than one slot may have this address for the s390 PCI driver, the wrong slot may be selected. To resolve this we're adding a new naming schema version with the flag NAMING_SLOT_FUNCTION_ID, which enables the correct matching of hotplug slots if the device has an attribute named function_id. The ID_NET_NAME_SLOT property will only be produced if there's a file /sys/bus/pci/slots/<slotname> where <slotname> matches the value of /sys/bus/pci/devices/.../function_id in 8 char hex notation. Fixes #19016 See also #19078
* tree-wide: use -EINVAL for enum invalid valuesZbigniew Jędrzejewski-Szmek2021-02-101-1/+1
| | | | | | | | | As suggested in https://github.com/systemd/systemd/pull/11484#issuecomment-775288617. This does not touch anything exposed in src/systemd. Changing the defines there would be a compatibility break. Note that tests are broken after this commit. They will be fixed in the next one.
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* net_id: fix newly added naming scheme nameLennart Poettering2020-10-221-1/+1
| | | | | | | v246 is long released. Hence the new scheme should be named v247. (Interesting, how we pretty systematically for the last releases changed the scheme only every second release)
* udev/net_id: don't generate slot based names if multiple devices might claim ↵Michal Sekletár2020-10-191-0/+2
| | | | the same slot
* nspawn: Generate unique short veth namesKai Krakow2020-01-021-0/+2
| | | | | | | | This commit lowers the chance of having veth name conflicts for machines created with similar names. Replaces: #12865 Fixes: #13417
* udev: move naming-scheme.[ch] into src/shared/Lennart Poettering2020-01-021-0/+53
That way we can use it from non-udev code too, for example nspawn.