Summary: | Ordering of .link files is inverted | ||
---|---|---|---|
Product: | systemd | Reporter: | Vincent Bernat <bernat> |
Component: | general | Assignee: | Tom Gundersen <teg> |
Status: | RESOLVED NOTABUG | QA Contact: | systemd-bugs |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | udev: fix ordering of .link files |
Thanks for the report and the patch. This is indeed annoying. The issue is that numbers are sorted before letters (regular strcmp()), a workaround is to rename your custom link files to 50-lan.link and 50-wlan.link. I Independantly of the ordering of letters and numbers, the ordering seem to be inverted. "wlan.link" is ordered before "lan.link". According to the man page: "The first (in lexical order) of the link files that matches a given device is applied." Using your example of wlan.link, lan.link, and 99-default.link, lexographical sorting is 99-default.link, lan.link, wlan.link. Assuming they all match, 99-default.link wins. Yes, you are right, I was confused by the output of udevadm. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.
Created attachment 108391 [details] udev: fix ordering of .link files Hi! Whatever I put in /etc/systemd/network, udev is still only using /lib/systemd/network/99-default.link. I am using systemd-215 from Debian but this is still true for the one in git. See: $ udevadm test-builtin net_setup_link /sys/class/net/lan calling: test-builtin load module index timestamp of '/etc/systemd/network' changed timestamp of '/lib/systemd/network' changed Parsed configuration file /etc/systemd/network/wlan.link Parsed configuration file /etc/systemd/network/lan.link Parsed configuration file /lib/systemd/network/99-default.link Created link configuration context. ID_NET_DRIVER=e1000e Config file /lib/systemd/network/99-default.link applies to device lan ID_NET_NAME=eno1 unload module index Unloaded link configuration context. My lan.link should match. When I apply the attached patch, the issue is fixed.