]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libuuid: check clock value from LIBUUID_CLOCK_FILE
authorMichael Trapp <michael.trapp@sap.com>
Tue, 2 Aug 2022 12:16:43 +0000 (14:16 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 22 Aug 2022 10:27:13 +0000 (12:27 +0200)
The clock value from the LIBUUID_CLOCK_FILE must be checked in
case of an update of libuuid. If clock==CLOCK_SEQ_CONT it must
be set to a new value.

Signed-off-by: Karel Zak <kzak@redhat.com>
libuuid/src/gen_uuid.c

index 807dcd11510346fb4dd49d25f31faae8a8c861ef..e1ba3c3d0e993253a1059cc75ed822832b26c2ee 100644 (file)
@@ -274,6 +274,11 @@ static int get_clock(uint32_t *clock_high, uint32_t *clock_low,
                        last.tv_usec = tv2;
                        adjustment = a;
                }
+               // reset in case of reserved CLOCK_SEQ_CONT
+               if (clock_seq == CLOCK_SEQ_CONT) {
+                       last.tv_sec = 0;
+                       last.tv_usec = 0;
+               }
        }
 
        if ((last.tv_sec == 0) && (last.tv_usec == 0)) {