mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-15 21:48:07 +02:00
Change nm_platform_link_get() to return the cached NMPlatformLink instance. Now what all our implementations (fake and linux) have such a cache internal object, let's just expose it directly. Note that the lifetime of the exposed link object is possibly quite short. A caller must copy the returned value if he intends to preserve it for later. Also add nm_platform_link_get_by_ifname() and modify nm_platform_link_get_by_address() to return the instance. Certain functions, such as nm_platform_link_get_name(), nm_platform_link_get_ifindex(), etc. are solely implemented based on looking at the returned NMPlatformLink object. No longer implement them as virtual functions but instead implement them in the base class (nm-platform.c). This removes code and eliminates the redundancy of the exposed NMPlatformLink instance and the nm_platform_link_get_*() accessors. Thereby also fix a bug in NMFakePlatform that tracked the link address in a separate "address" field, instead of using "link.addr". That was a case where the redundancy actually led to a bug in fake platform. Also remove some stub implementations in NMFakePlatform that just bail out. Instead allow for a missing virtual functions and perform the "default" action in the accessor. An example for that is nm_platform_link_get_permanent_address(). |
||
|---|---|---|
| .. | ||
| tests | ||
| wifi | ||
| Makefile.am | ||
| nm-fake-platform.c | ||
| nm-fake-platform.h | ||
| nm-linux-platform.c | ||
| nm-linux-platform.h | ||
| nm-platform-utils.c | ||
| nm-platform-utils.h | ||
| nm-platform.c | ||
| nm-platform.h | ||
| nmp-object.c | ||
| nmp-object.h | ||