summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Giudici <fgiudici@redhat.com>2019-05-13 12:10:50 +0200
committerFrancesco Giudici <fgiudici@redhat.com>2019-07-05 14:12:21 +0200
commit3775f31cb9ecb5993ce5631ad0f805b2215ca0e3 (patch)
tree5052b417fc820fe397d6478df3adca8da4a07d5c
parent97ce488f5f50d630b51b9bab52560fd0bce991c9 (diff)
downloadNetworkManager-3775f31cb9ecb5993ce5631ad0f805b2215ca0e3.tar.gz
dhcp/internal: expose on D-Bus the lease time dhcp option
It was already exposed implicity as the expiration time: add also the explicit option using same format of dhclient dhcp plugin. In the meanwhile, drop the SD_DHCP_OPTION_CLIENT_IDENTIFIER as not used.
-rw-r--r--src/dhcp/nm-dhcp-systemd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/dhcp/nm-dhcp-systemd.c b/src/dhcp/nm-dhcp-systemd.c
index 6df0a73017..31a10bfb08 100644
--- a/src/dhcp/nm-dhcp-systemd.c
+++ b/src/dhcp/nm-dhcp-systemd.c
@@ -134,11 +134,11 @@ static const ReqOption dhcp4_requests[] = {
REQ (SD_DHCP_OPTION_PRIVATE_CLASSLESS_STATIC_ROUTE, "ms_classless_static_routes", TRUE ),
REQ (SD_DHCP_OPTION_PRIVATE_PROXY_AUTODISCOVERY, "wpad", TRUE ),
REQ (SD_DHCP_OPTION_ROOT_PATH, "root_path", TRUE ),
+ REQ (SD_DHCP_OPTION_IP_ADDRESS_LEASE_TIME, "dhcp_lease_time", FALSE ),
/* Internal values */
- REQ (SD_DHCP_OPTION_IP_ADDRESS_LEASE_TIME, "expiry", FALSE ),
- REQ (SD_DHCP_OPTION_CLIENT_IDENTIFIER, "dhcp_client_identifier", FALSE ),
REQ (DHCP_OPTION_IP_ADDRESS, "ip_address", FALSE ),
+ REQ (DHCP_OPTION_EXPIRY, "expiry", FALSE ),
{ 0 }
};
@@ -318,8 +318,9 @@ lease_to_ip4_config (NMDedupMultiIndex *multi_idx,
(long long) (ts_time + a_lifetime));
add_option_u64 (options,
dhcp4_requests,
- SD_DHCP_OPTION_IP_ADDRESS_LEASE_TIME,
+ DHCP_OPTION_EXPIRY,
(guint64) (ts_time + a_lifetime));
+ add_option_u64 (options, dhcp4_requests, SD_DHCP_OPTION_IP_ADDRESS_LEASE_TIME, a_lifetime);
nm_ip4_config_add_address (ip4_config,
&((const NMPlatformIP4Address) {