mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-28 20:20:34 +01:00
NMPGlobalTracker allows to track objects for independent users/callers. That is, callers that are not aware whether another caller tracks the same/similar object. It thus groups all objects by their nmp_object_id_equal() (as `TrackObjData` struct), while keeping a list of each individually tracked object (as `TrackData` struct which honors the object and the user-tag parameter). When the same caller (based on the user-tag) tracks the same object again, then NMPGlobalTracker will only track it once and combine the objects. That is done by also having a dictionary for the `TrackData` entries (`self->by_data`). This latter dictionary lookup wrongly considered nmp_object_id_equal(). Instead, it needs to consider all minor differences of the objects, and use nmp_object_equal(). For example, for NMPlatformMptcpAddress, only the "address" is part of the ID. Other fields, like the MPTCP flags are not. Imagine a profile is active with MPTCP endpoints configured with flags "subflow". During reapply, the user can only update the MPTCP flags (e.g. to "signal"). When that happens, the caller (NML3Cfg) would track a new NMPlatformMptcpAddress instance, that only differs by MPTCP flags. In this case, we need to track the new address for the differences that it has according to nmp_object_equal(), and not nmp_object_id_equal(). Due to this bug, reapply might not work correctly. For other supported types (routing rules and routes) this bug may have been harder to reproduce, because most attributes of rules/routes are also part of the ID and because it's uncommon to reapply a minor change to a rule/route. https://bugzilla.redhat.com/show_bug.cgi?id=2120471 Fixes: |
||
|---|---|---|
| .. | ||
| tests | ||
| wifi | ||
| wpan | ||
| meson.build | ||
| nm-linux-platform.c | ||
| nm-linux-platform.h | ||
| nm-netlink.c | ||
| nm-netlink.h | ||
| nm-platform-private.h | ||
| nm-platform-utils.c | ||
| nm-platform-utils.h | ||
| nm-platform.c | ||
| nm-platform.h | ||
| nmp-base.h | ||
| nmp-netns.c | ||
| nmp-netns.h | ||
| nmp-object.c | ||
| nmp-object.h | ||
| nmp-route-manager.c | ||
| nmp-route-manager.h | ||
| README.md | ||
libnm-platform
A static helper library that provides NMPlatform and other utils.
This is NetworkManager's internal netlink library, but also contains
helpers for sysfs, ethtool and other kernel APIs.
NMPlaform is also a cache of objects of the netlink API: NMPCache
and NMPObject. These objects are used throughout NetworkManager
also for generally tracking information about these types. For example,
NMPlatformIP4Address (the public part of a certain type of NMPObject)
is not only used to track platform addresses from netlink in the cache,
but to track information about IPv4 addresses in general.
This depends on the following helper libraries