diff options
author | Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com> | 2018-05-25 10:34:38 -0400 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-11-12 18:45:57 +0100 |
commit | 55b6530baacf4658a183b15b010a8cf3483fde08 (patch) | |
tree | 2dfee16bd47684c55042f1663c25c60a91c203da | |
parent | 60d540fabd6fbffdd4192affd269e8119ea61d03 (diff) | |
download | systemd-55b6530baacf4658a183b15b010a8cf3483fde08.tar.gz systemd-55b6530baacf4658a183b15b010a8cf3483fde08.tar.bz2 systemd-55b6530baacf4658a183b15b010a8cf3483fde08.zip |
Always rename an interface to its name specified in config if no NamePolicy= is specified
This is for issue #9006
-rw-r--r-- | src/udev/net/link-config.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index c39d8791f2..b9c95e6139 100644 --- a/src/udev/net/link-config.c +++ b/src/udev/net/link-config.c @@ -312,16 +312,11 @@ static bool should_rename(sd_device *device, bool respect_predictable) { return true; switch (type) { - case NET_NAME_USER: - case NET_NAME_RENAMED: - /* these were already named by userspace, do not touch again */ - return false; case NET_NAME_PREDICTABLE: /* the kernel claims to have given a predictable name */ if (respect_predictable) return false; _fallthrough_; - case NET_NAME_ENUM: default: /* the name is known to be bad, or of an unknown type */ return true; @@ -443,12 +438,8 @@ int link_config_apply(link_config_ctx *ctx, link_config *config, } } - if (should_rename(device, respect_predictable)) { - /* if not set by policy, fall back manually set name */ - if (!new_name) - new_name = config->name; - } else - new_name = NULL; + if (!new_name && should_rename(device, respect_predictable)) + new_name = config->name; switch (config->mac_policy) { case MACPOLICY_PERSISTENT: |