summaryrefslogtreecommitdiff
path: root/src/network/networkctl.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-05-12 21:07:14 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-05-14 09:18:29 +0900
commit1a3caa49d757ed0b90f86d0f1c3eee55a1588e61 (patch)
treedeed0a1663b26e3a83816c789f5b6059e9caba51 /src/network/networkctl.c
parent170e88c8e3f321590688e4cd68e829ef6abe7101 (diff)
downloadsystemd-1a3caa49d757ed0b90f86d0f1c3eee55a1588e61.tar.gz
udev,network: make link_get_type_string() return negative errno on failure
And make net_match_config() propagate the error.
Diffstat (limited to 'src/network/networkctl.c')
-rw-r--r--src/network/networkctl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/network/networkctl.c b/src/network/networkctl.c
index 52abcddd64..d60b75a045 100644
--- a/src/network/networkctl.c
+++ b/src/network/networkctl.c
@@ -715,7 +715,9 @@ static int list_links(int argc, char *argv[], void *userdata) {
setup_state = strdup("unmanaged");
setup_state_to_color(setup_state, &on_color_setup, NULL);
- t = link_get_type_string(links[i].sd_device, links[i].iftype);
+ r = link_get_type_string(links[i].sd_device, links[i].iftype, &t);
+ if (r == -ENOMEM)
+ return log_oom();
r = table_add_many(table,
TABLE_INT, links[i].ifindex,
@@ -1436,7 +1438,9 @@ static int link_status_one(
(void) sd_device_get_property_value(info->sd_device, "ID_MODEL", &model);
}
- t = link_get_type_string(info->sd_device, info->iftype);
+ r = link_get_type_string(info->sd_device, info->iftype, &t);
+ if (r == -ENOMEM)
+ return log_oom();
(void) sd_network_link_get_network_file(info->ifindex, &network);