NetworkManager/src/libnm-platform
Thomas Haller 052ed480a6
platform: fix "-Wcast-align" warning on i686 in nmp_object_ref()
With gcc-12.2.1-4.fc37 on i686 we get:

  ./src/libnm-platform/nmp-object.h: In function 'nmp_object_ref':
  ./src/libnm-platform/nmp-object.h:626:12: error: cast increases required alignment of target type [-Werror=cast-align]
    626 |     return (const NMPObject *) nm_dedup_multi_obj_ref((const NMDedupMultiObj *) obj);
        |            ^
  cc1: all warnings being treated as errors

Work around that be increasing the alignment of NMDedupMultiObj.
It has no downsides, because we usually put a NMDedupMultiObj in heap
allocated memory, which is already suitably aligned. Or we put it on
the stack, where wasting a few bytes for the alignment doesn't matter.
We basically never embed NMDedupMultiObj in an array where the increase
of alignment would waste additional space.
2022-12-14 09:46:33 +01:00
..
tests platform: ensure all NMPlatform* structs have same alignment 2022-12-09 09:15:54 +01:00
wifi all: cleanup close() handling and clarify nm_close()/nm_close_with_error() 2022-10-25 13:12:48 +02:00
wpan platform: change nlmsg_alloc*() functions 2022-10-17 10:30:44 +02:00
meson.build platform: add "nmp-base.c" source 2022-09-23 11:43:35 +02:00
nm-linux-platform.c all: fix various "-Wcast-align=strict" warnings 2022-12-09 09:15:56 +01:00
nm-linux-platform.h platform: allow disabling caching of tc objects 2021-09-20 13:27:16 +02:00
nm-netlink.c all: fix various "-Wcast-align=strict" warnings 2022-12-09 09:15:56 +01:00
nm-netlink.h all: fix various "-Wcast-align=strict" warnings 2022-12-09 09:15:56 +01:00
nm-platform-private.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-platform-utils.c platform: make "now" timestamp an in/out parameter to nmp_utils_lifetime_get() 2022-04-08 15:59:48 +02:00
nm-platform-utils.h platform: make "now" timestamp an in/out parameter to nmp_utils_lifetime_get() 2022-04-08 15:59:48 +02:00
nm-platform.c support loopback interface 2022-11-23 20:51:22 +01:00
nm-platform.h platform: ensure all NMPlatform* structs have same alignment 2022-12-09 09:15:54 +01:00
nmp-base.c platform: move NMPlatformIP[46]Address to "nmp-plobj.c" 2022-09-23 11:43:36 +02:00
nmp-base.h platform: move NMPlatformIP[46]Address to "nmp-plobj.c" 2022-09-23 11:43:36 +02:00
nmp-global-tracker.c platform: fix tracking similar objects in NMPGlobalTracker 2022-09-15 18:18:26 +02:00
nmp-global-tracker.h mptcp: fix nmp_global_tracker_sync_mptcp_addrs() 2022-08-10 11:35:28 +02:00
nmp-netns.c all: use nm_g_array_{index,first,last,index_p}() instead of g_array_index() 2022-09-15 12:39:07 +02:00
nmp-netns.h build: move "shared/nm-platform" to "src/libnm-platform" 2021-02-24 12:48:17 +01:00
nmp-object.c platform: drop inline cmp() wrappers around "full" versions 2022-11-21 17:56:48 +01:00
nmp-object.h platform: fix "-Wcast-align" warning on i686 in nmp_object_ref() 2022-12-14 09:46:33 +01:00
nmp-plobj.c platform: move NMPlatformIP[46]Address to "nmp-plobj.c" 2022-09-23 11:43:36 +02:00
nmp-plobj.h platform: ensure all NMPlatform* structs have same alignment 2022-12-09 09:15:54 +01:00
README.md platform: support IPv6 mulitpath routes and fix cache inconsistency 2022-02-16 09:59:49 +01:00

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