X-Git-Url: https://git.decadent.org.uk/gitweb/?p=odhcp6c.git;a=blobdiff_plain;f=src%2Fodhcp6c.c;h=d70546b366ed4c7ebd47c554922d9ea27cd6860c;hp=274a97ab7dbe188d97e0ff7580781d04444f90a7;hb=feec1ad5767b977ce47e6738930c99c22ba0ce9c;hpb=dbf89816bd12d727dc7b006406f619ff3d2da382 diff --git a/src/odhcp6c.c b/src/odhcp6c.c index 274a97a..d70546b 100644 --- a/src/odhcp6c.c +++ b/src/odhcp6c.c @@ -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);