]> git.decadent.org.uk Git - odhcp6c.git/blobdiff - src/odhcp6c.c
Fix IA expiring logic
[odhcp6c.git] / src / odhcp6c.c
index 274a97ab7dbe188d97e0ff7580781d04444f90a7..d70546b366ed4c7ebd47c554922d9ea27cd6860c 100644 (file)
@@ -470,7 +470,7 @@ void odhcp6c_expire(void)
        static time_t last_update = 0;
        time_t now = odhcp6c_get_milli_time() / 1000;
 
-       uint32_t elapsed = now - last_update;
+       uint32_t elapsed = (last_update > 0) ? now - last_update : 0;
        last_update = now;
 
        odhcp6c_expire_list(STATE_RA_PREFIX, elapsed);