chiark / gitweb /
udev: link-config - only set *name on success
authorTom Gundersen <teg@jklm.no>
Mon, 8 Sep 2014 12:17:46 +0000 (14:17 +0200)
committerTom Gundersen <teg@jklm.no>
Mon, 8 Sep 2014 13:09:07 +0000 (15:09 +0200)
src/udev/net/link-config.c

index c2881d6..64ff00d 100644 (file)
@@ -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;
 }