From 302a5cebe4cfa9411a9d27c5ee0cc7122b073333 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 10 May 2023 12:59:33 +0200 Subject: [PATCH] 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. --- src/libnm-core-aux-intern/nm-libnm-core-utils.h | 7 +++++++ 1 file changed, 7 insertions(+) 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);