chiark / gitweb /
networkd: dhcp - update the lifetime of an existing address
authorTom Gundersen <teg@jklm.no>
Sun, 29 Jun 2014 14:59:33 +0000 (16:59 +0200)
committerTom Gundersen <teg@jklm.no>
Sun, 29 Jun 2014 15:01:23 +0000 (17:01 +0200)
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.

src/network/networkd-link.c

index dff445b..b597b16 100644 (file)
@@ -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));