summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-08-26 21:23:02 +0200
committerThomas Haller <thaller@redhat.com>2020-09-07 16:11:49 +0200
commit137d02a7e60660641ecd6547283f5d0a2056c2c6 (patch)
tree48aa469ef319d3887e2aa2df126300d4f95f262c /src
parent97c1bed37e46906f5450f53333e903c679f47ffe (diff)
downloadNetworkManager-137d02a7e60660641ecd6547283f5d0a2056c2c6.tar.gz
platform: add nm_platform_ip_address_get_peer_address() helper
Diffstat (limited to 'src')
-rw-r--r--src/platform/nm-platform.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/platform/nm-platform.h b/src/platform/nm-platform.h
index cece00dfe9..48c656ff56 100644
--- a/src/platform/nm-platform.h
+++ b/src/platform/nm-platform.h
@@ -1919,6 +1919,18 @@ gboolean nm_platform_ip_address_flush (NMPlatform *self,
int addr_family,
int ifindex);
+static inline gconstpointer
+nm_platform_ip_address_get_peer_address (int addr_family,
+ const NMPlatformIPAddress *addr)
+{
+ nm_assert_addr_family (addr_family);
+ nm_assert (addr);
+
+ if (NM_IS_IPv4 (addr_family))
+ return &((NMPlatformIP4Address *) addr)->peer_address;
+ return &((NMPlatformIP6Address *) addr)->peer_address;
+}
+
void nm_platform_ip_route_normalize (int addr_family,
NMPlatformIPRoute *route);