mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-14 13:08:07 +02:00
platform: remove unreachable code in nm_platform_link_get_all()
Linux platform tracks links by ifindex. Hence an ifindex must be unique and positive. Just assert against it.
This commit is contained in:
parent
6f5cb596ba
commit
5b208e718a
1 changed files with 2 additions and 7 deletions
|
|
@ -444,15 +444,10 @@ nm_platform_link_get_all (NMPlatform *self)
|
|||
for (i = 0; i < links->len; i++) {
|
||||
item = &g_array_index (links, NMPlatformLink, i);
|
||||
|
||||
if (item->ifindex <= 0 || g_hash_table_contains (unseen, GINT_TO_POINTER (item->ifindex))) {
|
||||
_LOGT ("link-get: SKIP: %3d: %s", i, nm_platform_link_to_string (item));
|
||||
g_warn_if_reached ();
|
||||
item->ifindex = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
_LOGT ("link-get: %3d: %s", i, nm_platform_link_to_string (item));
|
||||
|
||||
nm_assert (item->ifindex > 0 && !g_hash_table_contains (unseen, GINT_TO_POINTER (item->ifindex)));
|
||||
|
||||
g_hash_table_insert (unseen, GINT_TO_POINTER (item->ifindex), NULL);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue