diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-08-27 02:12:27 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-08-27 02:13:59 +0200 |
commit | 21b80ad126c1aa43bd6d0e5a7ed3cc7c0f10efb0 (patch) | |
tree | 38d07d9a8d62c1ff8bb3294b1eb95932dc380551 /src/network/networkd-dhcp4.c | |
parent | fbcd420aa407dc3c16efd9fb32cbae6d04d4f65d (diff) |
networkd: optionally push dhcp timezone into timedated
Diffstat (limited to 'src/network/networkd-dhcp4.c')
-rw-r--r-- | src/network/networkd-dhcp4.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c index 3082bf8ac8..4e2936f637 100644 --- a/src/network/networkd-dhcp4.c +++ b/src/network/networkd-dhcp4.c @@ -482,6 +482,18 @@ static int dhcp_lease_acquired(sd_dhcp_client *client, Link *link) { } } + if (link->network->dhcp_timezone) { + const char *tz = NULL; + + (void) sd_dhcp_lease_get_timezone(link->dhcp_lease, &tz); + + if (tz) { + r = link_set_timezone(link, tz); + if (r < 0) + log_link_error_errno(link, r, "Failed to set timezone to '%s': %m", tz); + } + } + if (!link->network->dhcp_critical) { r = sd_dhcp_lease_get_lifetime(link->dhcp_lease, &lifetime); if (r < 0) { |