network: address-pool: also check conflicts with foreign addresses

Fixes CI issue found in
https://github.com/systemd/systemd-centos-ci/pull/334.
This commit is contained in:
Yu Watanabe
2021-01-17 23:23:08 +00:00
committed by Luca Boccassi
parent 0da7f9e589
commit aac6673f02
+9
View File
@@ -107,6 +107,15 @@ static bool address_pool_prefix_is_taken(
return true;
}
/* Don't clash with assigned foreign addresses */
SET_FOREACH(a, l->addresses_foreign) {
if (a->family != p->family)
continue;
if (in_addr_prefix_intersect(p->family, u, prefixlen, &a->in_addr, a->prefixlen))
return true;
}
/* Don't clash with addresses already pulled from the pool, but not assigned yet */
SET_FOREACH(a, l->pool_addresses) {
if (a->family != p->family)