diff options
author | Thomas Haller <thaller@redhat.com> | 2023-05-10 12:59:33 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2023-05-12 12:42:49 +0200 |
commit | 302a5cebe4cfa9411a9d27c5ee0cc7122b073333 (patch) | |
tree | a7f226dc6b2392c9bcf6f6be511c361ce533bbed | |
parent | a206042eda16abdb4df71a510be78480036048b2 (diff) | |
download | NetworkManager-302a5cebe4cfa9411a9d27c5ee0cc7122b073333.tar.gz |
libnm-core: add internal _nm_ip_route_ref() helper
For some reason, nm_ip_route_ref() does not return the referenced instance,
making it cumbersome to use. Add a helper.
-rw-r--r-- | src/libnm-core-aux-intern/nm-libnm-core-utils.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libnm-core-aux-intern/nm-libnm-core-utils.h b/src/libnm-core-aux-intern/nm-libnm-core-utils.h index 589291e5a9..b1336731be 100644 --- a/src/libnm-core-aux-intern/nm-libnm-core-utils.h +++ b/src/libnm-core-aux-intern/nm-libnm-core-utils.h @@ -21,6 +21,13 @@ #define nm_auto_unref_ip_address nm_auto(_nm_ip_address_unref) NM_AUTO_DEFINE_FCN0(NMIPAddress *, _nm_ip_address_unref, nm_ip_address_unref); +static inline NMIPRoute * +_nm_ip_route_ref(NMIPRoute *route) +{ + nm_ip_route_ref(route); + return route; +} + #define nm_auto_unref_ip_route nm_auto(_nm_auto_unref_ip_route) NM_AUTO_DEFINE_FCN0(NMIPRoute *, _nm_auto_unref_ip_route, nm_ip_route_unref); |