]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/network/networkd-link.c
networkd: Clean up pool addresses on link down
authorRichard Maw <richard.maw@codethink.co.uk>
Tue, 6 Jun 2017 14:43:24 +0000 (15:43 +0100)
committerRichard Maw <richard.maw@codethink.co.uk>
Mon, 12 Jun 2017 15:20:49 +0000 (16:20 +0100)
commit410a7f15f0c6a96cd3b6a73f4a6465a5abfb9d0a
tree8067d41ff90cf0c6ab8b39ab08636f9565e80f13
parent42d3bf86bb75842602d3712caa2baccd09a1c795
networkd: Clean up pool addresses on link down

When the link comes up it assigns addresses
by checking whether the address is 0.0.0.0,
and if so pulling a new address range out of the pool.

If the addresses aren't removed from the pool when the link goes down
then the set of addresses allocated will grow
until all the local address ranges are exhausted,
while it gets a different IP address every time.

This patch frees the addresses when link config is dropped
to fix the address leak,
and on systems which can expect all interfaces to be brought up or down
in a deterministic order this conveniently makes use the same address each time.
src/network/networkd-link.c