From ae5b77925237a59f5faa4e008b330383b8690cb2 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 20 Jul 2020 13:42:49 +0900 Subject: [PATCH 1/2] networkctl: sort alternative names --- src/network/networkctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/network/networkctl.c b/src/network/networkctl.c index a80a6185dab..1427508dcdf 100644 --- a/src/network/networkctl.c +++ b/src/network/networkctl.c @@ -1486,6 +1486,7 @@ static int link_status_one( if (r < 0) return table_log_add_error(r); + strv_sort(info->alternative_names); r = dump_list(table, "Alternative Names:", info->alternative_names); if (r < 0) return r; From 48c53989513bfa00f7fcd2c2975665bc0f9c606c Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 20 Jul 2020 13:43:38 +0900 Subject: [PATCH 2/2] networkctl: do not ignore -EOPNOTSUPP when reading netlink message If the kernel does not support alternative interface names, then sd_netlink_message_read_strv() should just return -ENODATA. --- src/network/networkctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/networkctl.c b/src/network/networkctl.c index 1427508dcdf..48182e61ddf 100644 --- a/src/network/networkctl.c +++ b/src/network/networkctl.c @@ -380,7 +380,7 @@ static int decode_link(sd_netlink_message *m, LinkInfo *info, char **patterns, b return r; r = sd_netlink_message_read_strv(m, IFLA_PROP_LIST, IFLA_ALT_IFNAME, &altnames); - if (r < 0 && !IN_SET(r, -EOPNOTSUPP, -ENODATA)) + if (r < 0 && r != -ENODATA) return r; if (patterns) {