diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2017-06-09 17:18:25 +0200 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2017-06-12 17:54:42 +0200 |
commit | 45a9eac9a0c85c0c76b46388a530edd335ae44af (patch) | |
tree | 17549add403c49048202acb0fcd2eddb22c0a91f /src/network | |
parent | networkd: Wait for link to get carrier before setting addresses (diff) | |
download | systemd-45a9eac9a0c85c0c76b46388a530edd335ae44af.tar.xz 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.c | 2 |
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; |