mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 05:18:23 +02:00
core: add nm_ip6_config_new_cloned() function
This commit is contained in:
parent
dc4d0a4200
commit
dfdce13cee
2 changed files with 15 additions and 2 deletions
|
|
@ -77,6 +77,18 @@ nm_ip6_config_new (int ifindex)
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NMIP6Config *
|
||||||
|
nm_ip6_config_new_cloned (const NMIP6Config *src)
|
||||||
|
{
|
||||||
|
NMIP6Config *new;
|
||||||
|
|
||||||
|
g_return_val_if_fail (NM_IS_IP6_CONFIG (src), NULL);
|
||||||
|
|
||||||
|
new = nm_ip6_config_new (nm_ip6_config_get_ifindex (src));
|
||||||
|
nm_ip6_config_replace (new, src, NULL);
|
||||||
|
return new;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
nm_ip6_config_get_ifindex (const NMIP6Config *config)
|
nm_ip6_config_get_ifindex (const NMIP6Config *config)
|
||||||
{
|
{
|
||||||
|
|
@ -962,8 +974,8 @@ nm_ip6_config_replace (NMIP6Config *dst, const NMIP6Config *src, gboolean *relev
|
||||||
const NMPlatformIP6Address *dst_addr, *src_addr;
|
const NMPlatformIP6Address *dst_addr, *src_addr;
|
||||||
const NMPlatformIP6Route *dst_route, *src_route;
|
const NMPlatformIP6Route *dst_route, *src_route;
|
||||||
|
|
||||||
g_return_val_if_fail (src != NULL, FALSE);
|
g_return_val_if_fail (NM_IS_IP6_CONFIG (src), FALSE);
|
||||||
g_return_val_if_fail (dst != NULL, FALSE);
|
g_return_val_if_fail (NM_IS_IP6_CONFIG (dst), FALSE);
|
||||||
g_return_val_if_fail (src != dst, FALSE);
|
g_return_val_if_fail (src != dst, FALSE);
|
||||||
|
|
||||||
#if NM_MORE_ASSERTS
|
#if NM_MORE_ASSERTS
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@ GType nm_ip6_config_get_type (void);
|
||||||
|
|
||||||
|
|
||||||
NMIP6Config * nm_ip6_config_new (int ifindex);
|
NMIP6Config * nm_ip6_config_new (int ifindex);
|
||||||
|
NMIP6Config * nm_ip6_config_new_cloned (const NMIP6Config *src);
|
||||||
|
|
||||||
int nm_ip6_config_get_ifindex (const NMIP6Config *config);
|
int nm_ip6_config_get_ifindex (const NMIP6Config *config);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue