mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-15 08:00:37 +01:00
platform: add nm_platform_ip_route_get_pref_src() helper
This commit is contained in:
parent
7d6c1a0f43
commit
b386381ffc
1 changed files with 13 additions and 0 deletions
|
|
@ -2306,6 +2306,19 @@ nm_platform_ip_route_get_gateway(int addr_family, const NMPlatformIPRoute *route
|
|||
return &((NMPlatformIP6Route *) route)->gateway;
|
||||
}
|
||||
|
||||
static inline gconstpointer
|
||||
nm_platform_ip_route_get_pref_src(int addr_family, const NMPlatformIPRoute *route)
|
||||
{
|
||||
nm_assert_addr_family(addr_family);
|
||||
|
||||
if (!route)
|
||||
return NULL;
|
||||
|
||||
if (NM_IS_IPv4(addr_family))
|
||||
return &((NMPlatformIP4Route *) route)->pref_src;
|
||||
return &((NMPlatformIP6Route *) route)->pref_src;
|
||||
}
|
||||
|
||||
int nm_platform_ip_route_add(NMPlatform *self,
|
||||
NMPNlmFlags flags,
|
||||
const NMPObject *route,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue