summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/sd-dhcp-lease.c
diff options
context:
space:
mode:
authorPatrik Flykt <Patrik.Flykt@linux.intel.com>2014-06-26 16:18:43 +0300
committerTom Gundersen <teg@jklm.no>2014-06-29 15:18:21 +0200
commit68ceb9df6a39a7f86ffc3cf8266ca677a5d5271b (patch)
treee9cc615604eb921ce54bdf1bdcb9bf4a9a1d9f14 /src/libsystemd-network/sd-dhcp-lease.c
parent7c16313f11e3953f3fe4dbf544f2d36f58d14138 (diff)
sd-dhcp-client/networkd: set lifetimes for IPv4 addresses
Note that /proc/sys/net/ipv4/ip_dynaddr needs to be non-zero. [tomegun: hook up DHCP renew events to increase the lifetime when necessary]
Diffstat (limited to 'src/libsystemd-network/sd-dhcp-lease.c')
-rw-r--r--src/libsystemd-network/sd-dhcp-lease.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c
index 3203b7a592..94ba283cf0 100644
--- a/src/libsystemd-network/sd-dhcp-lease.c
+++ b/src/libsystemd-network/sd-dhcp-lease.c
@@ -47,6 +47,15 @@ int sd_dhcp_lease_get_address(sd_dhcp_lease *lease, struct in_addr *addr) {
return 0;
}
+int sd_dhcp_lease_get_lifetime(sd_dhcp_lease *lease, uint32_t *lifetime) {
+ assert_return(lease, -EINVAL);
+ assert_return(lease, -EINVAL);
+
+ *lifetime = lease->lifetime;
+
+ return 0;
+}
+
int sd_dhcp_lease_get_mtu(sd_dhcp_lease *lease, uint16_t *mtu) {
assert_return(lease, -EINVAL);
assert_return(mtu, -EINVAL);