kernel-netlink: Ignore deprecated candidate source addresses
The currently used address may get deprecated e.g. if an IPv6 prefix changes. In this case we should switch to another address. Fixes #3511.
This commit is contained in:
@@ -942,8 +942,9 @@ static host_t *get_matching_address(private_kernel_netlink_net_t *this,
|
|||||||
{ /* optionally match a subnet */
|
{ /* optionally match a subnet */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (candidate && candidate->ip_equals(candidate, addr->ip))
|
if (candidate && candidate->ip_equals(candidate, addr->ip) &&
|
||||||
{ /* stop if we find the candidate */
|
!(addr->flags & IFA_F_DEPRECATED))
|
||||||
|
{ /* stop if we find the candidate and it's not deprecated */
|
||||||
best = addr;
|
best = addr;
|
||||||
candidate_matched = TRUE;
|
candidate_matched = TRUE;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user