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.
This commit is contained in:
Thomas Haller 2023-05-10 12:59:33 +02:00
parent a206042eda
commit 302a5cebe4
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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);