summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-01-27 20:52:07 +0100
committerTom Gundersen <teg@jklm.no>2014-01-30 14:30:39 +0100
commiteb27aeca247a4cf8816fffc4c0dbcab55ead3864 (patch)
tree4c27a114379b0874f229db32aad3df9138f41164 /src/network/networkd-link.c
parente7fb33ffefcdc68ad096eea7444da877b68390e8 (diff)
networkd: dhcpv4 - add notion of 'CriticalConnection'
These connections are never torn down, even when the DHCP specifications say that they should be. This is useful/necessary when the rootfs (or another critical fs) is mounted over this network connection, and dataloss would result if the connection is lost. This option defaults to off, but our initrd generator (TBD) will enable it when applicable.
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r--src/network/networkd-link.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index d9622ac4b7..9b5ebeda20 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -443,6 +443,12 @@ static void dhcp_handler(sd_dhcp_client *client, int event, void *userdata) {
if (event == DHCP_EVENT_IP_CHANGE || event == DHCP_EVENT_EXPIRED ||
event == DHCP_EVENT_STOP) {
+ if (link->network->dhcp_critical) {
+ log_warning_link(link, "DHCPv4 connection considered system critical, "
+ "ignoring request to reconfigure it down.");
+ return;
+ }
+
if (link->dhcp_address) {
address_drop(link->dhcp_address, link, address_drop_handler);