summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-05-10 12:59:33 +0200
committerThomas Haller <thaller@redhat.com>2023-05-12 12:42:49 +0200
commit302a5cebe4cfa9411a9d27c5ee0cc7122b073333 (patch)
treea7f226dc6b2392c9bcf6f6be511c361ce533bbed
parenta206042eda16abdb4df71a510be78480036048b2 (diff)
downloadNetworkManager-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.h7
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);