naccyde / rpms / systemd

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