summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-06-18 18:22:14 +0200
committerLennart Poettering <lennart@poettering.net>2014-06-18 18:28:29 +0200
commit11bf3cced13c885ca215c108cb0bdb7a148520d6 (patch)
treea4b0af55dee44c786b80bcfab13e3eb0f3f84a4e /src/network/networkd-link.c
parent059f6c42b744a18d0deec0c79a9e0730ec6c1c76 (diff)
networkd: add address pool support
When an address is configured to be all zeroes, networkd will now automatically find a locally unused network of the right size from a list of pre-configured pools. Currently those pools are 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 and fc00::/7, i.e. the network ranges for private networks. They are compiled in, but should be configurable eventually. This allows applying the same configuration to a large number of interfaces with each time a different IP range block, and management of these IP ranges is fully automatic. When allocating an address range from the pool it is made sure the range is not used otherwise.
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r--src/network/networkd-link.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index d81a3bf63..e7753dc98 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -112,6 +112,11 @@ static void link_free(Link *link) {
address_free(address);
}
+ while ((address = link->pool_addresses)) {
+ LIST_REMOVE(addresses, link->pool_addresses, address);
+ address_free(address);
+ }
+
sd_dhcp_client_unref(link->dhcp_client);
sd_dhcp_lease_unref(link->dhcp_lease);