projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3d11b46
)
network: do not trigger assertion when link_get_by_index() called with an invalid...
author
Yu Watanabe
<watanabe.yu+github@gmail.com>
Mon, 11 Dec 2023 16:27:09 +0000
(
01:27
+0900)
committer
Yu Watanabe
<watanabe.yu+github@gmail.com>
Thu, 14 Dec 2023 09:57:43 +0000
(18:57 +0900)
Should not change any behavior. Preparation for later commit.
src/network/networkd-link.c
patch
|
blob
|
history
diff --git
a/src/network/networkd-link.c
b/src/network/networkd-link.c
index a063696c82b12a7d073edf4c0951efb420f70f5f..0162e2acb0308d43b36d4b7cb5d4effe0af54fb0 100644
(file)
--- 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)