summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-address-pool.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-01-17 16:44:14 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2021-01-18 00:23:08 +0100
commitaac6673f026229bdad3f57758560b1de186b043c (patch)
tree67411aac6f9669bb34fad700f7d560d4035de75c /src/network/networkd-address-pool.c
parenthwdb: Add NEWYES 10" LCD writing tablet (#18274) (diff)
downloadsystemd-aac6673f026229bdad3f57758560b1de186b043c.tar.xz
systemd-aac6673f026229bdad3f57758560b1de186b043c.zip
network: address-pool: also check conflicts with foreign addresses
Fixes CI issue found in https://github.com/systemd/systemd-centos-ci/pull/334.
Diffstat (limited to 'src/network/networkd-address-pool.c')
-rw-r--r--src/network/networkd-address-pool.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/network/networkd-address-pool.c b/src/network/networkd-address-pool.c
index a9f8872760..c60ece5db8 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)