]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
vb_date is microseconds since the epoch, i.e. an external time, and so SHOULD NOT...
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 18 Dec 2019 03:46:24 +0000 (10:46 +0700)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 18 Dec 2019 03:46:24 +0000 (10:46 +0700)
src/lib/util/value.c

index 01f0ff3ce6f1a8394af5fa02807f4beda317e6b5..3453511e971bbef730132189eccea92662e25831 100644 (file)
@@ -1468,7 +1468,7 @@ ssize_t fr_value_box_from_network(TALLOC_CTX *ctx,
                switch (precision) {
                default:
                case FR_TIME_RES_SEC: /* external seconds, internal nanoseconds */
-                       date *= 1000000000;
+                       date *= NSEC;
                        break;
 
                case FR_TIME_RES_MSEC:
@@ -1483,13 +1483,7 @@ ssize_t fr_value_box_from_network(TALLOC_CTX *ctx,
                        break;
                }
 
-               /*
-                *      Convert nanoseconds to struct timespec.
-                */
-               ts.tv_sec = date / NSEC;
-               ts.tv_nsec = date % NSEC;
-
-               dst->vb_date = fr_time_from_timespec(&ts);
+               dst->vb_date = date;
        }
                break;