diff options
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r-- | src/network/networkd-link.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index a063696c82..0162e2acb0 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -252,7 +252,9 @@ int link_get_by_index(Manager *m, int ifindex, Link **ret) { Link *link; assert(m); - assert(ifindex > 0); + + if (ifindex <= 0) + return -EINVAL; link = hashmap_get(m->links_by_index, INT_TO_PTR(ifindex)); if (!link) |