mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-11 22:40:23 +01:00
core: zero ifindex is not valid, use interface name instead (rh #894653)
otherwise an assertion in libnl's rtnl_link_build_get_request() is hit.
This commit is contained in:
parent
57a2a532ac
commit
6eaa232865
1 changed files with 1 additions and 1 deletions
|
|
@ -1865,7 +1865,7 @@ nm_system_get_iface_type (int ifindex, const char *name)
|
|||
goto out;
|
||||
|
||||
/* Prefer interface indexes to names */
|
||||
err = rtnl_link_get_kernel (nlh, ifindex, ifindex < 0 ? name : NULL, &result);
|
||||
err = rtnl_link_get_kernel (nlh, ifindex, ifindex <= 0 ? name : NULL, &result);
|
||||
if (err < 0) {
|
||||
if (err == -NLE_OPNOTSUPP)
|
||||
res = nm_system_compat_get_iface_type (ifindex, name);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue