]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkctl: do not ignore -EOPNOTSUPP when reading netlink message 16519/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 20 Jul 2020 04:43:38 +0000 (13:43 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 20 Jul 2020 06:24:40 +0000 (15:24 +0900)
If the kernel does not support alternative interface names, then
sd_netlink_message_read_strv() should just return -ENODATA.

src/network/networkctl.c

index 1427508dcdfd27cab6c85a7a62a057646832d0dd..48182e61ddfe803003b1601ec0f8d9c6be991867 100644 (file)
@@ -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) {