platform: add nm_platform_ip_address_get_peer_address() helper

This commit is contained in:
Thomas Haller 2020-08-26 21:23:02 +02:00
parent 97c1bed37e
commit 137d02a7e6
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

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