From: Yu Watanabe Date: Sun, 17 Jan 2021 15:44:14 +0000 (+0900) Subject: network: address-pool: also check conflicts with foreign addresses X-Git-Tag: v248-rc1~312 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aac6673f026229bdad3f57758560b1de186b043c;p=thirdparty%2Fsystemd.git network: address-pool: also check conflicts with foreign addresses Fixes CI issue found in https://github.com/systemd/systemd-centos-ci/pull/334. --- diff --git a/src/network/networkd-address-pool.c b/src/network/networkd-address-pool.c index a9f8872760d..c60ece5db8c 100644 --- a/src/network/networkd-address-pool.c +++ b/src/network/networkd-address-pool.c @@ -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)