From 05f2a0b0247ee4aa3da371658f310bc655cbf1af Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 15 Jun 2021 19:04:39 +0200 Subject: [PATCH] libnm: expose nm_ip_address_dup(), nm_ip_route_dup() API in libnm This fixes commit 21c8a6b20eff ('libnm-core, all: merge IPv4 and IPv6 address/route types'), which introduced this API but didn't export it in the library. In practice this API is thus only usable since 1.32.0. --- src/libnm-client-impl/libnm.ver | 2 ++ src/libnm-core-impl/nm-setting-ip-config.c | 12 ++++++++++++ src/libnm-core-public/nm-setting-ip-config.h | 3 +++ 3 files changed, 17 insertions(+) diff --git a/src/libnm-client-impl/libnm.ver b/src/libnm-client-impl/libnm.ver index 3637f1b840..65d52b1a03 100644 --- a/src/libnm-client-impl/libnm.ver +++ b/src/libnm-client-impl/libnm.ver @@ -1788,6 +1788,8 @@ global: libnm_1_32_0 { global: nm_ethtool_optname_is_pause; + nm_ip_address_dup; + nm_ip_route_dup; nm_setting_match_new; nm_setting_wired_get_accept_all_mac_addresses; } libnm_1_30_0; diff --git a/src/libnm-core-impl/nm-setting-ip-config.c b/src/libnm-core-impl/nm-setting-ip-config.c index 1336df3037..5a5f714c8c 100644 --- a/src/libnm-core-impl/nm-setting-ip-config.c +++ b/src/libnm-core-impl/nm-setting-ip-config.c @@ -364,6 +364,12 @@ nm_ip_address_equal(NMIPAddress *address, NMIPAddress *other) * Creates a copy of @address * * Returns: (transfer full): a copy of @address + * + * This API was part of public headers before 1.32.0 but + * was erroneously not exported in the ABI. It is thus only + * usable since 1.32.0. + * + * Since: 1.32 **/ NMIPAddress * nm_ip_address_dup(NMIPAddress *address) @@ -821,6 +827,12 @@ nm_ip_route_equal(NMIPRoute *route, NMIPRoute *other) * Creates a copy of @route * * Returns: (transfer full): a copy of @route + * + * This API was part of public headers before 1.32.0 but + * was erroneously not exported in the ABI. It is thus only + * usable since 1.32.0. + * + * Since: 1.32 **/ NMIPRoute * nm_ip_route_dup(NMIPRoute *route) diff --git a/src/libnm-core-public/nm-setting-ip-config.h b/src/libnm-core-public/nm-setting-ip-config.h index f48f99a283..de15dd540f 100644 --- a/src/libnm-core-public/nm-setting-ip-config.h +++ b/src/libnm-core-public/nm-setting-ip-config.h @@ -49,6 +49,8 @@ gboolean nm_ip_address_equal(NMIPAddress *address, NMIPAddress *other); NM_AVAILABLE_IN_1_22 int nm_ip_address_cmp_full(const NMIPAddress *a, const NMIPAddress *b, NMIPAddressCmpFlags cmp_flags); + +NM_AVAILABLE_IN_1_32 NMIPAddress *nm_ip_address_dup(NMIPAddress *address); int nm_ip_address_get_family(NMIPAddress *address); @@ -92,6 +94,7 @@ enum { /*< flags >*/ NM_AVAILABLE_IN_1_10 gboolean nm_ip_route_equal_full(NMIPRoute *route, NMIPRoute *other, guint cmp_flags); +NM_AVAILABLE_IN_1_32 NMIPRoute *nm_ip_route_dup(NMIPRoute *route); int nm_ip_route_get_family(NMIPRoute *route);