summaryrefslogtreecommitdiff
path: root/src/network/networkctl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-11-02 23:57:21 +0100
committerLennart Poettering <lennart@poettering.net>2015-11-03 00:02:00 +0100
commit6ad623a3f77e087e308f334525fd4046811f2a9a (patch)
tree1030c9d7eb6e88cc605c36ed50901d4527a4fcf1 /src/network/networkctl.c
parent6a37c684695befff2d2ce7e0fcce90e25e2e252c (diff)
parse-util: introduce parse_ifindex() and make use of it everywhere
We have enough places where we parse an ifindex, hence introduce a proper parsing function for it, that verifies all parameters.
Diffstat (limited to 'src/network/networkctl.c')
-rw-r--r--src/network/networkctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/networkctl.c b/src/network/networkctl.c
index 97c1fe6560..ba7e3ba74a 100644
--- a/src/network/networkctl.c
+++ b/src/network/networkctl.c
@@ -521,7 +521,7 @@ static int link_status_one(
assert(rtnl);
assert(name);
- if (safe_atoi(name, &ifindex) >= 0 && ifindex > 0)
+ if (parse_ifindex(name, &ifindex) >= 0)
r = sd_rtnl_message_new_link(rtnl, &req, RTM_GETLINK, ifindex);
else {
r = sd_rtnl_message_new_link(rtnl, &req, RTM_GETLINK, 0);