From ae58e9065e34a4027856f41e2c5e5565a53dab90 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sat, 25 Oct 2014 15:47:55 +0200 Subject: [PATCH] udev: fix ordering of .link files The list of `.link` files to read from various directories is built with the inverse order: $ 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. With this patch: $ 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 /lib/systemd/network/99-default.link Parsed configuration file /etc/systemd/network/lan.link Parsed configuration file /etc/systemd/network/wlan.link Created link configuration context. ID_NET_DRIVER=e1000e Config file /etc/systemd/network/lan.link applies to device lan ID_NET_NAME=lan unload module index Unloaded link configuration context. --- src/udev/net/link-config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index 25e3cc8dfb08..6dff280fba2a 100644 --- a/src/udev/net/link-config.c +++ b/src/udev/net/link-config.c @@ -208,7 +208,7 @@ int link_config_load(link_config_ctx *ctx) { return r; } - STRV_FOREACH_BACKWARDS(f, files) { + STRV_FOREACH(f, files) { r = load_link(ctx, *f); if (r < 0) return r; -- 2.1.1