aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-06-29 16:59:33 +0200
committerTom Gundersen <teg@jklm.no>2014-06-29 17:01:23 +0200
commit46ba9fbae2517e6fee2a2b486ef9f06a62284b8c (patch)
treef51ec4e2b97b74402aa26071faf927b5b391c108
parentsd-dhcp-client: don't fail hard if UDP socket can not be bound (diff)
downloadsystemd-46ba9fbae2517e6fee2a2b486ef9f06a62284b8c.tar.gz
systemd-46ba9fbae2517e6fee2a2b486ef9f06a62284b8c.tar.bz2
systemd-46ba9fbae2517e6fee2a2b486ef9f06a62284b8c.zip
networkd: dhcp - update the lifetime of an existing address
The logic otherwise is that we leave anything preconfigured alone, but in the case of DHCP we actually need to update it whenever the lease is renewed.
-rw-r--r--src/network/networkd-link.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index dff445bc5..b597b1668 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -760,7 +760,9 @@ static int link_enter_set_addresses(Link *link) {
address->prefixlen = prefixlen;
address->broadcast.s_addr = addr.s_addr | ~netmask.s_addr;
- r = address_configure(address, link, &address_handler);
+ /* use update rather than configure so that we will update the lifetime
+ of an existing address if it has already been configured */
+ r = address_update(address, link, &address_handler);
if (r < 0) {
log_warning_link(link,
"could not set addresses: %s", strerror(-r));