dryang / rpms / systemd

Forked from rpms/systemd a year ago
Clone
a8c905
From eeea9a2f94b5defb97c20c62a23345a367a734aa Mon Sep 17 00:00:00 2001
a8c905
From: Yu Watanabe <watanabe.yu+github@gmail.com>
a8c905
Date: Tue, 17 Dec 2019 20:41:21 +0900
a8c905
Subject: [PATCH] udev: sort alternative names
a8c905
a8c905
Kernel preserves the order of alternative names. So, for user
a8c905
visibility, let's sort the alternative names.
a8c905
a8c905
(cherry picked from commit 4d016e965b13883cccc963a34a1299a0c4f900ca)
a8c905
a8c905
Related: #1850986
a8c905
---
a8c905
 src/udev/net/link-config.c | 1 +
a8c905
 1 file changed, 1 insertion(+)
a8c905
a8c905
diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c
a8c905
index 6ceb4c698e..8bd374d352 100644
a8c905
--- a/src/udev/net/link-config.c
a8c905
+++ b/src/udev/net/link-config.c
a8c905
@@ -515,6 +515,7 @@ int link_config_apply(link_config_ctx *ctx, link_config *config,
a8c905
                 strv_remove(altnames, new_name);
a8c905
         strv_remove(altnames, old_name);
a8c905
         strv_uniq(altnames);
a8c905
+        strv_sort(altnames);
a8c905
 
a8c905
         r = rtnl_set_link_alternative_names(&ctx->rtnl, ifindex, altnames);
a8c905
         if (r == -EOPNOTSUPP)