systemd/0195-udev-link-config-only-set-name-on-success.patch

32 lines
949 B
Diff
Raw Normal View History

2014-10-04 02:43:52 +00:00
From d95b83b87d7d7c50e550f7128827f73a321c8934 Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg@jklm.no>
Date: Mon, 8 Sep 2014 14:17:46 +0200
Subject: [PATCH] udev: link-config - only set *name on success
---
src/udev/net/link-config.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c
index c2881d6b41..64ff00dc0d 100644
--- a/src/udev/net/link-config.c
+++ b/src/udev/net/link-config.c
@@ -424,8 +424,6 @@ int link_config_apply(link_config_ctx *ctx, link_config *config,
} else
new_name = NULL;
- *name = new_name;
-
switch (config->mac_policy) {
case MACPOLICY_PERSISTENT:
if (mac_is_random(device)) {
@@ -459,6 +457,8 @@ int link_config_apply(link_config_ctx *ctx, link_config *config,
return r;
}
+ *name = new_name;
+
return 0;
}