diff options
| author | Michael Biebl <biebl@debian.org> | 2017-02-16 00:00:34 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2017-02-16 00:00:34 +0100 |
| commit | a222e56e103f949b148a6942e385ccca2c26d9f3 (patch) | |
| tree | 7978165f4d291224c854adb4c96c863a924b4882 /src/platform | |
| parent | 7f4dff3943c64e1d0e5d13b2ac915088dde165e6 (diff) | |
New upstream version 1.6.2 upstream/1.6.2
Diffstat (limited to 'src/platform')
| -rw-r--r-- | src/platform/nm-platform.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c index 8b22ced2..a9014b36 100644 --- a/src/platform/nm-platform.c +++ b/src/platform/nm-platform.c @@ -2864,6 +2864,18 @@ ip4_addr_subnets_build_index (const GArray *addresses, gboolean consider_flags) return subnets; } +/** + * ip4_addr_subnets_is_secondary: + * @address: an address + * @subnets: the hash table mapping subnets to addresses + * @addresses: array of addresses in the hash table + * @out_addr_list: array of addresses belonging to the same subnet + * + * Checks whether @address is secondary and returns in @out_addr_list the list of addresses + * belonging to the same subnet, if it contains other elements. + * + * Returns: %TRUE if the address is secondary, %FALSE otherwise + */ static gboolean ip4_addr_subnets_is_secondary (const NMPlatformIP4Address *address, GHashTable *subnets, const GArray *addresses, GPtrArray **out_addr_list) { @@ -2876,13 +2888,13 @@ ip4_addr_subnets_is_secondary (const NMPlatformIP4Address *address, GHashTable * nm_assert (p); if (!_ptr_inside_ip4_addr_array (addresses, p)) { addr_list = p; - if (addr_list->pdata[0] != address) { - NM_SET_OUT (out_addr_list, addr_list); + NM_SET_OUT (out_addr_list, addr_list); + if (addr_list->pdata[0] != address) return TRUE; - } - } else + } else { nm_assert ((gconstpointer) address == p); - NM_SET_OUT (out_addr_list, NULL); + NM_SET_OUT (out_addr_list, NULL); + } return FALSE; } |