summaryrefslogtreecommitdiff
path: root/src/network/networkd-address-pool.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-09-23 01:53:29 +0200
committerTom Gundersen <teg@jklm.no>2015-10-11 15:04:16 +0200
commitcf1d700da3fe04cd4c27980a292301694be3b05f (patch)
tree1637158da3463b4f94a6522818fd941c95e6cfc4 /src/network/networkd-address-pool.c
parent200a0868fcdf7b95f3d8d1fda3aa2aef48d84fdd (diff)
networkd: address - store active addresses in a Set rather than a List
We need to be able to look these things up quickly as we will be updating them continuously and there can in principle be many of them.
Diffstat (limited to 'src/network/networkd-address-pool.c')
-rw-r--r--src/network/networkd-address-pool.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/network/networkd-address-pool.c b/src/network/networkd-address-pool.c
index d609daafde..b3450c1456 100644
--- a/src/network/networkd-address-pool.c
+++ b/src/network/networkd-address-pool.c
@@ -21,6 +21,7 @@
#include "networkd.h"
#include "networkd-address-pool.h"
+#include "set.h"
int address_pool_new(
Manager *m,
@@ -96,9 +97,10 @@ static bool address_pool_prefix_is_taken(
HASHMAP_FOREACH(l, p->manager->links, i) {
Address *a;
+ Iterator j;
/* Don't clash with assigned addresses */
- LIST_FOREACH(addresses, a, l->addresses) {
+ SET_FOREACH(a, l->addresses, j) {
if (a->family != p->family)
continue;