mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-09 13:30:20 +01: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(). |
||
|---|---|---|
| .. | ||
| adsl | ||
| bluetooth | ||
| team | ||
| wifi | ||
| wwan | ||
| nm-device-bond.c | ||
| nm-device-bond.h | ||
| nm-device-bridge.c | ||
| nm-device-bridge.h | ||
| nm-device-ethernet-utils.c | ||
| nm-device-ethernet-utils.h | ||
| nm-device-ethernet.c | ||
| nm-device-ethernet.h | ||
| nm-device-factory.c | ||
| nm-device-factory.h | ||
| nm-device-generic.c | ||
| nm-device-generic.h | ||
| nm-device-gre.c | ||
| nm-device-gre.h | ||
| nm-device-infiniband.c | ||
| nm-device-infiniband.h | ||
| nm-device-logging.h | ||
| nm-device-macvlan.c | ||
| nm-device-macvlan.h | ||
| nm-device-private.h | ||
| nm-device-tun.c | ||
| nm-device-tun.h | ||
| nm-device-veth.c | ||
| nm-device-veth.h | ||
| nm-device-vlan.c | ||
| nm-device-vlan.h | ||
| nm-device-vxlan.c | ||
| nm-device-vxlan.h | ||
| nm-device.c | ||
| nm-device.h | ||