summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2017-06-09 16:18:25 +0100
committerRichard Maw <richard.maw@codethink.co.uk>2017-06-12 16:54:42 +0100
commit45a9eac9a0c85c0c76b46388a530edd335ae44af (patch)
tree17549add403c49048202acb0fcd2eddb22c0a91f /src/network
parentc1835a427fddac41dcc780cf733b53e01721e8f2 (diff)
downloadsystemd-45a9eac9a0c85c0c76b46388a530edd335ae44af.tar.gz
systemd-45a9eac9a0c85c0c76b46388a530edd335ae44af.tar.bz2
systemd-45a9eac9a0c85c0c76b46388a530edd335ae44af.zip
networkd: Allow DHCP servers to be re-configured on carrier gain
In normal operation this would trigger an assertion when a DHCP server is configured every time the link goes up. This change makes sd_dhcp_server_configure_pool idempotent and stops the DHCP server when the link loses carrier. In addition to this stopping the assertion being triggered, this has the useful side-effect of allowing the link to be taken down and then brought back up as a way to have it use DNS from an "upstream" interface that got its DNS configuration via DHCP after the downstream link was configured.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-link.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 4af61df7ff..4c57fa1793 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -3060,6 +3060,8 @@ static int link_carrier_lost(Link *link) {
return r;
}
+ (void) sd_dhcp_server_stop(link->dhcp_server);
+
r = link_drop_config(link);
if (r < 0)
return r;