mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-18 02:30:30 +01:00
platform: accept %NULL route as parameter to nm_platform_ip_route_get_gateway()
It's sometimes convenient to accept %NULL and have a "maybe type" like behavior to propagate the %NULL input of the getter.
This commit is contained in:
parent
bcf31a9b29
commit
7faeda8351
1 changed files with 3 additions and 1 deletions
|
|
@ -2176,7 +2176,9 @@ static inline gconstpointer
|
|||
nm_platform_ip_route_get_gateway(int addr_family, const NMPlatformIPRoute *route)
|
||||
{
|
||||
nm_assert_addr_family(addr_family);
|
||||
nm_assert(route);
|
||||
|
||||
if (!route)
|
||||
return NULL;
|
||||
|
||||
if (NM_IS_IPv4(addr_family))
|
||||
return &((NMPlatformIP4Route *) route)->gateway;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue