mirror of
https://github.com/systemd/systemd.git
synced 2026-08-13 17:08:14 +00:00
network: do not trigger assertion when link_get_by_index() called with an invalid ifindex
Should not change any behavior. Preparation for later commit.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user