mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-01 22:20:12 +01:00
platform: add nm_platform_ip_address_delete() helper
(cherry picked from commit a60a262574)
This commit is contained in:
parent
c1682b2556
commit
0fc40735ab
1 changed files with 23 additions and 0 deletions
|
|
@ -2129,6 +2129,29 @@ gboolean nm_platform_ip4_address_delete(NMPlatform *self,
|
|||
gboolean
|
||||
nm_platform_ip6_address_delete(NMPlatform *self, int ifindex, struct in6_addr address, guint8 plen);
|
||||
|
||||
static inline gboolean
|
||||
nm_platform_ip_address_delete(NMPlatform *self,
|
||||
int addr_family,
|
||||
int ifindex,
|
||||
gconstpointer /* (const NMPlatformIPAddress *) */ addr)
|
||||
{
|
||||
if (NM_IS_IPv4(addr_family)) {
|
||||
const NMPlatformIP4Address *a = addr;
|
||||
|
||||
if (ifindex <= 0)
|
||||
ifindex = a->ifindex;
|
||||
|
||||
return nm_platform_ip4_address_delete(self, ifindex, a->address, a->plen, a->peer_address);
|
||||
} else {
|
||||
const NMPlatformIP6Address *a = addr;
|
||||
|
||||
if (ifindex <= 0)
|
||||
ifindex = a->ifindex;
|
||||
|
||||
return nm_platform_ip6_address_delete(self, ifindex, a->address, a->plen);
|
||||
}
|
||||
}
|
||||
|
||||
gboolean nm_platform_ip_address_sync(NMPlatform *self,
|
||||
int addr_family,
|
||||
int ifindex,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue